- William Hicks
- PowerBuilder
- Monday, 29 November 2021 12:19 PM UTC
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.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.