I have a Word Template containing VBA in a content type on SharePoint online. When a new document is created based on this content type Word desktop starts and VBA opens a dialog. The user can enter some values in the dialog and click on a custom Save button. The save button opens a Save As dialog in Word containing a filename derived from the user input. The new document needs to be saved in the SharePoint online library where it was created.
In Word 2016 on MacOS you can open a Save As dialog by using VBA or AppleScript. I have tried the following code:
VBA
With Application.Dialogs(wdDialogFileSaveAs)
.Name = " testdoc.docx"
.Show
End With
AppleScript
tell application "Microsoft Word"
activate
set tmpDialog to get dialog dialog file save as
display Word dialog tmpDialog
end tell
But this code opens a dialog showing only local storage options. See the print screen below.
What I need is the following dialog opened by code.
This is the dialog when you manually click Save As in Word.
How can you open this Word dialog by using VBA or AppleScript?