Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-05-2022, 04:03 AM
elaineAda elaineAda is offline Macro save a form generated from a template Windows XP Macro save a form generated from a template Office 2010
Novice
Macro save a form generated from a template
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant save document as docx or doc using macro in Word 2007 staicumihai Word VBA 1 04-27-2018 10:59 AM
Macro save a form generated from a template File will not save as docx. only doc. Library Worker Word 5 01-27-2016 09:40 AM
Macro save a form generated from a template Word 2007 , when I save a .doc or .docx file the file type is showing "Empty" Tomc29 Word 9 06-10-2015 03:04 AM
Macro save a form generated from a template Getting Macro To Work in .docx file on Website Mhangoy Word 6 09-06-2013 06:57 AM
Macro save a form generated from a template Can't Save a file as .docx the_lil Word 5 10-27-2011 08:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft