View Single Post
 
Old 11-05-2013, 11:07 AM
terraterm terraterm is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Nov 2013
Posts: 4
terraterm is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
The macro recorder only records the processes, not necessarily the dialogue boxes etc. you used to get them. Instead of the code you now have for the SaveAs, you should use:
Application.Dialogs(wdDialogFileSaveAs).Display
That will give you the SaveAs dialogue box, so you can choose the new name.
This is what my original macro looks like below.

I tried replacing the SaveAs dialogue box as you suggested, but i keep getting syntax error, or expected end of statement error msgs.

Where am i going wrong?

Thx!


Code:
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Paste
ActiveDocument.SaveAs FileName:="just some dummy text for testin1.docx", _
  FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _
  AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
  EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
  :=False, SaveAsAOCELetter:=False
ActiveWindow.Close
Documents.Add DocumentType:=wdNewBlankDocument
End Sub

Last edited by macropod; 11-05-2013 at 01:58 PM. Reason: Added code tags & formatting
Reply With Quote