locked
Word add-in (save from showdialog at ribbon button) RRS feed

  • Question

  • the platform is Word 2013 and VS 2013.

    i wish to write a addin to save file, the button is simply placed in the ribbon.   i do not know how to call ActiveDocument to save the file.  Grateful for any help.  thx.

    ****************************

    Imports Microsoft.Office.Tools.Ribbon
    Imports System.Windows.Forms
    Imports Microsoft.Office.Interop.Word

    Public Class Ribbon1
        Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs) Handles Button1.Click
            Dim abcd As New SaveFileDialog()
            abcd.ShowDialog()
            abcd.DefaultExt = "docx"
            abcd.Title = "save aS"
            abcd.InitialDirectory = "e:\"

            If abcd.ShowDialog() = DialogResult.OK Then

              ' activedocument.save() ????????????????

            End If
        End Sub
    End Class

    Tuesday, February 17, 2015 9:19 AM

Answers