View Single Post
 
Old 05-05-2022, 04:03 AM
elaineAda elaineAda is offline Windows XP Office 2010
Novice
 
Join Date: Mar 2019
Posts: 25
elaineAda is on a distinguished road
Default Macro save a form generated from a template

Hi
I have this macro for a command button in my template to save a form (word document when i open the template) after completion of the form. But i encountered run time error 4198 when i tried to run this in the word document generated from the template. Any help is appreciated. Thanks.


Code:
Private Sub SaveAsPDF_Click()

With Application.FileDialog(msoFileDialogSaveAs)
.FilterIndex = 3
.Show

If .SelectedItems.Count <> 0 Then
ThisDocument.SaveAs2 .SelectedItems(1), wdFormatDocument
End If
End With

End Sub
Thanks

Last edited by elaineAda; 05-05-2022 at 06:32 AM.
Reply With Quote