Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WordVBA - Document.Save throws Run-time Error 4198

Status
Not open for further replies.

jschenke

Programmer
Jun 19, 2001
48
0
0
BE
For our administrative dept, I'm working on a simple document management tool that will save backup copies of Word files in a pre-determined path, if a user-property has been set.

Since Word doesn't have a Document.SaveCopyAs method, I have to first Save the current document, then SaveAs to the backup location.

The problem is that when the file hasn't been saved before, the Save method will show a standard 'PutFile' dialog -- which is good, but if the user clicks 'Cancel' in this dialog, VBA will throw a run-time error '4198' and point at the Document.Save line when I try to debug it.

Does anybody have an idea of how to avoid this error ?

TIA,

Jan Schenkel.
 
Take a look at the On Error instruction.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top