A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro to Save Doc



 
 
Thread Tools Display Modes
  #1  
Old April 22nd, 2005, 07:49 PM
Aurora
external usenet poster
 
Posts: n/a
Default 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  
Old April 22nd, 2005, 10:10 PM
Charles Kenyon
external usenet poster
 
Posts: n/a
Default

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  
Old April 23rd, 2005, 12:25 AM
Dian D. Chapman, MVP
external usenet poster
 
Posts: n/a
Default

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  
Old April 23rd, 2005, 01:44 PM
Robert M. Franz
external usenet poster
 
Posts: n/a
Default

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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to save a file as a PDF ynissel General Discussion 8 May 25th, 2005 10:46 PM
How do I save an image that's a gif but the save as choice is cmarvel41 General Discussion 1 April 16th, 2005 10:19 PM
Welcome Screen, Macro to Save, Print? Frank Kabel Worksheet Functions 1 May 25th, 2004 12:04 PM
macro to save a workbook as a .csv file type carl Worksheet Functions 2 November 5th, 2003 08:20 PM
Macro won't close file w/o displaying box to save changes Jay Worksheet Functions 3 October 25th, 2003 04:11 AM


All times are GMT +1. The time now is 05:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.