none
Setting default file type in save as dialog with VBA RRS feed

  • Question

  • Hello,

    I am making a "template template" and am trying to make it as simple as possible for my users - I have a "Create New Template" button in my word 2007 macro enabled template, and am able to get the save as dialog box to open, but I do not know what to enter into the .format argument to have the default file type be a macro enabled template.  I also need to be able to have the other button on this document create a macro enabled document, can anyone fill me in on what to type for this property?  The code I am using is as follows:

    Private Sub SaveNewTemplate_Click()

    With Application.Dialogs(wdDialogFileSaveAs)

            .Format = (Need correct syntax)

            .Show

    End With

    End Sub

    Any help would be appreciated.  Thanks.

    • Moved by Max Meng Friday, February 17, 2012 5:38 AM Moving to a more appropriate forum (From:Word IT Pro Discussions)
    Thursday, February 16, 2012 4:47 PM

Answers

  • Here is a link to the Developers Reference and it shows all of the enumeration.  An alternative approach to just coding the number is:

    With Application.Dialogs(wdDialogFileSaveAs)
            .Format = Word.WdSaveFormat.wdFormatXMLTemplateMacroEnabled
            .Show
    End With


    Kind Regards, Rich ... http://greatcirclelearning.com

    • Marked as answer by Matt Bennion Thursday, February 23, 2012 5:03 PM
    Friday, February 17, 2012 11:48 AM

All replies

  • Private Sub SaveNesdwTemplate_Click()

    With Application.Dialogs(wdDialogFileSaveAs)
            .Format = 15
            .Show
           

    End With

    End Sub

    Friday, February 17, 2012 7:28 AM
  • Here is a link to the Developers Reference and it shows all of the enumeration.  An alternative approach to just coding the number is:

    With Application.Dialogs(wdDialogFileSaveAs)
            .Format = Word.WdSaveFormat.wdFormatXMLTemplateMacroEnabled
            .Show
    End With


    Kind Regards, Rich ... http://greatcirclelearning.com

    • Marked as answer by Matt Bennion Thursday, February 23, 2012 5:03 PM
    Friday, February 17, 2012 11:48 AM