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
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