'save as' using macro but with overwrite protection

J

Jesse

At the top, I am not sure if this is the correct group. If not,
please suggest the right one.

The problem: Every day I have to create a file using an Access file
and a mail merge in Word (Office 2000). The merged doc has to be
saved in XML, which means I also have to change the doc type manually
to .txt first.

So, I recorded a macro for one-click file saving, which "saves" me the
clicks to change doc type and is otherwise efficient. But, if it is
about to overwrite an existing file it does not give me a warning. I
would like to get that warning. Is there a way to set the code so
that Word will warn me?

Here is my existing code, as recorded:

Sub XML_Save()
'
' XML_Save Macro
' Macro recorded 8/29/2007 by jk
'
ChangeFileOpenDirectory "C:\xml_files\20070829\"
ActiveDocument.SaveAs FileName:="test111.xml",
FileFormat:=wdFormatText, _
LockComments:=False, Password:="", AddToRecentFiles:=True,
WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False,
SaveAsAOCELetter:= _
False

End Sub

Also, is there a straightforward way for the macro to auto-name the
file by appending to a fixed name the current date in yyyymmdd format
(i.e., 20070829)? If so, help would be appreciated. TIA. -- Jesse
 
G

Graham Mayor

If you install the Word 2007 compatibility pack, Word 2000 will add the
option to save as XML to the file save dialog.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top