Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 11-05-2013, 11:07 AM
terraterm terraterm is offline Word Macro saving with different filename Windows 7 64bit Word Macro saving with different filename Office 2007
Novice
Word Macro saving with different filename
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Macro saving with different filename Saving as ( PowerPoint Macro-Enabled Slide Show )?? delete123 PowerPoint 2 04-10-2013 05:38 AM
Word Macro saving with different filename A macro that can insert FILENAME, sendkeys CTRL ALT T, paste clipboard, and nextline kyjac85 Word VBA 13 09-20-2012 05:00 PM
Word Macro saving with different filename Problem saving in Word 2007 a dotm Addin developed in Word 2010 RichardP Word VBA 6 04-26-2012 04:22 AM
Macro for automatically adding filename without .doc RPM7 Word VBA 0 04-29-2010 01:43 AM
Word: The document 'Filename' caused a serious error the last time ... martincruise Word 0 02-25-2010 01:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:16 PM.


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