Results 1 to 7 of 7

Thread: SaveAs Dialog box in Word 2016

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Apr 2017
    Posts
    38
    Location

    SaveAs Dialog box in Word 2016

    Hi everyone,

    I need your help. I'm trying to get the VBA code to call the SaveAs dialog box so that when a user saves the document for the first time the name (based on the information of the Content Control in the file) and file format (.docm) are preloaded and the user simply needs to manually choose the folder where to save the file (I used an event to intercept printing which works wonderfully - I didn't include it in the attached because I want to keep the focus on the SaveAs dialog box). I didn't have any issues at all using the code below with Word 2010 (see the attached file): In fact, I can call the SaveAs dialog with preset File Name and Format:

    -------------------------------------------------------------------------------------------------------------------
    Sub SaveAs_Dialog()
    Dim dlgsaveas As Dialog
    Set dlgsaveas = Dialogs(wdDialogFileSaveAs)
    With dlgsaveas
    .Name = ActiveDocument.SelectContentControlsByTag("Name").Item(1).Range.Text & " - " & ActiveDocument.SelectContentControlsByTag("Number").Item(1).Range.Text
    .Format = wdFormatXMLDocumentMacroEnabled
    .Show
    End With
    End Sub
    -------------------------------------------------------------------------------------------------------------------

    Unfortunately though this code doesn't work with Word 2016 since the dialog box is different and I guess it's triggered through a different code. I found some code to call the SaveAs Dialog in Word 2016 but I couldn't fine any code where I can set the "Name" and "Format" as I was able to easily do in in the code above.

    Thank you in advance for your support!

    Regards

    Massimo
    Attached Files Attached Files
    Last edited by max76; 03-21-2018 at 03:14 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •