Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-28-2012, 03:13 AM
jillapass jillapass is offline Saveas error handling Windows 7 32bit Saveas error handling Office 2007
Novice
Saveas error handling
 
Join Date: Dec 2011
Posts: 26
jillapass is on a distinguished road
Default

Hello Paul



I have now made my code literally a few lines as show at the end as all the rest is just localisation. But, it still fails on the 2nd save wiht run-time error 4198: command failed.

I have to admit I am getting a bit frustrated now.
What I am trying to do is save a .dotm word template as a .docx using the name that the user enters, but I just don't seem to be able to achieve it. At the moment the users have to press save as and select word document, but this seems beyond their very limited ability which is why I thought I would automate it. I also need to keep a .dotm version in case they need to make changes at a later date.



myfilename = InputBox("Enter file name for document " & myfilename)
MsgBox myfilename '(this is just for me to see what I have entered)
ActiveDocument.SaveAs FileName:=myfilename, FileFormat:=wdFormatXMLTemplateMacroEnabled
Application.DisplayAlerts = False
ActiveDocument.SaveAs FileName:=myfilename, FileFormat:=wdFormatXMLDocument
Application.DisplayAlerts = True
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Saveas error handling Microsoft office 2010 error 2908 and error 1935 !!!!!!heeeeellpppp!!!!!!!!! bennypryde Office 1 01-05-2012 03:33 PM
Saveas error handling saveAs ChDir _ tinfanide Excel Programming 4 11-05-2011 01:40 AM
Handling Excel Data msofficeno475 Excel 1 01-17-2010 09:56 AM
Runtime error 5487 - Word cannot complete the save to to file permission error franferns Word 0 11-25-2009 05:35 AM
Handling ICALENDAR attachments l_kris06 Outlook 0 11-12-2008 07:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:16 AM.


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