Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Mike Hyndman
 
Posts: n/a
Default Macro for saving to two locations


I have tried to use the macro from G. Mayor's site which saves a
document in two locations, but when I try to do so I get a 5152 error
message, this is not a valid file name etc.,
I have created the necessary folder for the back up and debug opens with
the "ActiveDocument.SaveAs FileName:=strFileB" highlighted.

Sub SaveToTwoLocations()
Dim strFileA, strFileB, strFileC
ActiveDocument.Save
strFileA = ActiveDocument.Name

'Define backup path shown in blue below
strFileB = "C:\My Documents\Word Backup\Backup " & strFileA
strFileC = ActiveDocument.FullName
ActiveDocument.SaveAs FileName:=strFileB
ActiveDocument.SaveAs FileName:=strFileC
End Sub

I am using Word2K and Word2K3

Any help with this gratefully recieved.

Regards

Mike H
remove -bats- to reply

"Ingratitude is never having to say thankyou".
  #2   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman
 
Posts: n/a
Default Macro for saving to two locations

Hi Mike,

Double-check that the folder "C:\My Documents\Word Backup" exists. Note that
this is *not* in your "My Documents" pseudo-folder, which is actually
something like "C:\Documents and Settings\Mike\My Documents" (depending on
your login name).

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Mike Hyndman wrote:
I have tried to use the macro from G. Mayor's site which saves a
document in two locations, but when I try to do so I get a 5152 error
message, this is not a valid file name etc.,
I have created the necessary folder for the back up and debug opens
with the "ActiveDocument.SaveAs FileName:=strFileB" highlighted.

Sub SaveToTwoLocations()
Dim strFileA, strFileB, strFileC
ActiveDocument.Save
strFileA = ActiveDocument.Name

'Define backup path shown in blue below
strFileB = "C:\My Documents\Word Backup\Backup " & strFileA
strFileC = ActiveDocument.FullName
ActiveDocument.SaveAs FileName:=strFileB
ActiveDocument.SaveAs FileName:=strFileC
End Sub

I am using Word2K and Word2K3

Any help with this gratefully recieved.

Regards

Mike H
remove -bats- to reply

"Ingratitude is never having to say thankyou".



  #3   Report Post  
Posted to microsoft.public.word.newusers
Charles Kenyon
 
Posts: n/a
Default Macro for saving to two locations

It is highly unlikely that you have a "C:\My Documents" folder. Find the
real path to your My Documents folder. If you right-click on the folder on
your desktop or in the Start menu and select properties you should see the
full path.
--
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://word.mvps.org/FAQs/ which is awesome!

My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
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.


"Mike Hyndman" wrote in message
...

I have tried to use the macro from G. Mayor's site which saves a
document in two locations, but when I try to do so I get a 5152 error
message, this is not a valid file name etc.,
I have created the necessary folder for the back up and debug opens with
the "ActiveDocument.SaveAs FileName:=strFileB" highlighted.

Sub SaveToTwoLocations()
Dim strFileA, strFileB, strFileC
ActiveDocument.Save
strFileA = ActiveDocument.Name

'Define backup path shown in blue below
strFileB = "C:\My Documents\Word Backup\Backup " & strFileA
strFileC = ActiveDocument.FullName
ActiveDocument.SaveAs FileName:=strFileB
ActiveDocument.SaveAs FileName:=strFileC
End Sub

I am using Word2K and Word2K3

Any help with this gratefully recieved.

Regards

Mike H
remove -bats- to reply

"Ingratitude is never having to say thankyou".



  #4   Report Post  
Posted to microsoft.public.word.newusers
Mike Hyndman
 
Posts: n/a
Default Macro for saving to two locations

On Mon, 8 May 2006 10:05:13 -0500, "Charles Kenyon"
wrote:

It is highly unlikely that you have a "C:\My Documents" folder. Find the
real path to your My Documents folder. If you right-click on the folder on
your desktop or in the Start menu and select properties you should see the
full path.

D'oH!

I don't believe it! Many thanks, Jay and Charles, I was only two folders
short of the full path name. Works a treat.

Many thanks to you both.

Mike H


remove -bats- to reply

"Ingratitude is never having to say thankyou".
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
macro produces error message Kimmie B Microsoft Word Help 11 March 14th 06 11:25 PM
Macro Button Won't Stay on Toolbar caleb Microsoft Word Help 2 June 14th 05 11:59 PM
Possible bug when recording a Word Macro Raven95 Microsoft Word Help 4 April 30th 05 09:49 PM
Save As is not working due to macro security settings Craig Meritz Microsoft Word Help 1 December 16th 04 03:53 AM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM


All times are GMT +1. The time now is 01:45 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"