Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Long Documents / April 2005

Tip: Looking for answers? Try searching our database.

Macro to Save Doc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aurora - 22 Apr 2005 19:49 GMT
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
Charles Kenyon - 22 Apr 2005 22:10 GMT
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

Signature

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.

>I am using Word 2000
> I want to create a macro to save a document in a
[quoted text clipped - 10 lines]
>
> Aurora
Dian D. Chapman, MVP - 23 Apr 2005 00:25 GMT
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/Pub0009/LPMArticle.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

>I am using Word 2000
>I want to create a macro to save a document in a
[quoted text clipped - 10 lines]
>
>Aurora
Robert M. Franz - 23 Apr 2005 13:44 GMT
Hi Aurora

> I am using Word 2000
> I want to create a macro to save a document in a
[quoted text clipped - 6 lines]
> 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/ModifyRecordedMacro.htm

Greetinx
Robert
Signature

 /"\  ASCII Ribbon Campaign |   MS
 \ /                        |  MVP
  X        Against HTML     |  for
 / \     in e-mail & news   | Word


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.