Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro to Save Doc
I am using Word 2000
I want to create a macro to save a document in a particular file. I created a macro called (SAVE) and when thru the steps that I normally would to save a file beginning with "save file as". I clicked on the pause icon while recording to allow the user to enter a file name and then hit the resume icon, "save" and then stopped the macro. It worked as I was creating the macro. But when I run the macro it does not work. It doesn't give me any errors. Does anyone have any ideas???? Aurora |
#2
|
|||
|
|||
Your macro will use whatever name you used when you recorded it. This is one
of many reasons that recorded macros are a kludge, at best. Edit your macro and where you want the dialog insert Application.Dialogs(wdDialogFileSaveAs).Show -- Charles Kenyon Word New User FAQ & Web Directory: http://addbalance.com/word Intermediate User's Guide to Microsoft Word (supplemented version of Microsoft's Legal Users' Guide) http://addbalance.com/usersguide See also the MVP FAQ: http://www.mvps.org/word which is awesome! --------- --------- --------- --------- --------- --------- This message is posted to a newsgroup. Please post replies and questions to the newsgroup so that others can learn from my ignorance and your wisdom. "Aurora" wrote in message ... I am using Word 2000 I want to create a macro to save a document in a particular file. I created a macro called (SAVE) and when thru the steps that I normally would to save a file beginning with "save file as". I clicked on the pause icon while recording to allow the user to enter a file name and then hit the resume icon, "save" and then stopped the macro. It worked as I was creating the macro. But when I run the macro it does not work. It doesn't give me any errors. Does anyone have any ideas???? Aurora |
#3
|
|||
|
|||
You can't record this type of code and what you want to do is a bit
more complex than you think. You need to learn some VBA and write a procedure to do what you want. This isn't the most efficient way, since you should be using File System Object to set the folder path to the registry...but with little knowledge, you can use this code to do what you want. Plus, in order to overwrite the original SaveAs command, you need to call the macro FileSaveAs and not just Save. Add this code to your module and it'll do the job...more or less. However, change the "myFolder" to the correct path that you need set. But know that if the user doesn't have this path or if it is a network path that is different on their system, you'll get an error... Sub FileSaveAs() Dim strFileName As String Dim strPath As String strPath = "c:\myFolder" strFileName = InputBox("Enter the Save As name for this file") Application.ChangeFileOpenDirectory strPath ActiveDocument.SaveAs strFileName End Sub Note...to understand how to use the above code, read this TechTrax article: Sharing Macros http://pubs.logicalexpressions.com/P...cle.asp?ID=166 Dian D. Chapman, Technical Consultant Microsoft MVP, MOS Certified Editor/TechTrax Ezine Free MS Tutorials: http://www.mousetrax.com/techtrax Free Word eBook: http://www.mousetrax.com/books.html Optimize your business docs: http://www.mousetrax.com/consulting Learn VBA the easy way: http://www.mousetrax.com/techcourses.html On Fri, 22 Apr 2005 11:49:29 -0700, "Aurora" wrote: I am using Word 2000 I want to create a macro to save a document in a particular file. I created a macro called (SAVE) and when thru the steps that I normally would to save a file beginning with "save file as". I clicked on the pause icon while recording to allow the user to enter a file name and then hit the resume icon, "save" and then stopped the macro. It worked as I was creating the macro. But when I run the macro it does not work. It doesn't give me any errors. Does anyone have any ideas???? Aurora |
#4
|
|||
|
|||
Hi Aurora
Aurora wrote: I am using Word 2000 I want to create a macro to save a document in a particular file. I created a macro called (SAVE) and when thru the steps that I normally would to save a file beginning with "save file as". I clicked on the pause icon while recording to allow the user to enter a file name and then hit the resume icon, "save" and then stopped the macro. It worked as I was creating the macro. But when I run the macro it does not work. It doesn't give me any errors. The following brand new article on the MVP site should make a good read for you: How to modify a recorded macro (by Jay Freedman) http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm Greetinx Robert -- /"\ ASCII Ribbon Campaign | MS \ / | MVP X Against HTML | for / \ in e-mail & news | Word |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro for timestamp and save as | Microsoft Word Help | |||
How do I use macro/ other feature of word to save a new copy word | New Users | |||
How do use macro or some other feature to save a new copy of word. | Microsoft Word Help | |||
macro to save rtf file as txt | Microsoft Word Help | |||
Save As is not working due to macro security settings | Microsoft Word Help |