I open an existing Word document using oleobject and successfully manipulate the contents. The document is left open in Word for the user to make any further modifications and save as required. This is all ok.
I want to set the default path and file name so that if the user decides to save it they don't need to type the name and select the folder unless they want to save somewhere other than the standard location or with a different filename.
The closest thing I have found is this:
https://wordmvp.com/FAQs/MacrosVBA/SetDefFilename.htm
which I have simplified to this:
Sub chgsave()
Set dlgProp = Dialogs(wdDialogFileSummaryInfo)
dlgProp.Title = "myfile.docx"
dlgProp.Execute
End Sub
I have confirmed this works as Word macro but I have not managed to successfully convert this to PB code for my oleobject. I think my problem is getting hold of the Dialog. I believe it would be possible to call a macro from PB but I don't want to use macro-enabled documents.
Thanks in advance,
William.
thank you so much. You second piece of code seems to do the trick. One thing I had not appreciated was how to access the particular dialog through Item.
Regards,
William.