DrMarsha
Thu Jun 19 05:22:02 PDT 2008
Thank you..didn't realize save to both places was built in...is there a maco
such as this for Power Point and Excel as well? If so, might you direct me to
that macro?
"Graham Mayor" wrote:
> The macro from my web site
>
> Sub SaveToTwoLocations()
> Dim strFileA As String
> Dim strFileB As String
> Dim strFileC As String
> ActiveDocument.Save
> strFileA = ActiveDocument.Name
> 'Define backup path shown in blue below
> strFileB = "D:\My Documents\Word Backup\Backup " & strFileA
> strFileC = ActiveDocument.FullName
> ActiveDocument.SaveAs FileName:=strFileB
> ActiveDocument.SaveAs FileName:=strFileC
> End Sub
>
> saves the document with its original name and location (and gives the
> opportunity to name an unsaved document) and saves a second copy in the
> folder shown in blue i.e. D:\My Documents\Word Backup\ and appends "Backup
> " to the start of the filename. If the backup location is removable media,
> use the appropriate alternative macro from the same web page.
>
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site
http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> DrMarsha wrote:
> > That was it; thanks! One other thing...do you still need to click on
> > the Macro to save the file in the other location? I was hoping that
> > with one click, it would save to the original file location as well
> > as the macro back-up, but this still seems like you need to click
> > twice (one on save one on macro) to save it? What really is the
> > difference with this as compared to just saving it to two different
> > locations with the Save feature and not the macro??? Thanks!
> >
> > "StevenM" wrote:
> >
> >> Also, when you concatenated the path and filename, did you add the
> >> path seperator? (It is an easy thing to overlook.)
> >>
> >> Steven Craig Miller
> >>
> >> "DrMarsha" wrote:
> >>
> >>> I referenced the site gmayor.com but can't seem to get the macro to
> >>> run successfully...I think I am missing a step. When I click on the
> >>> Macro on the toolbar, I get the message:
> >>>
> >>> Microsoft Visual Basic
> >>> Run-time error '5152':
> >>> This is not a valid file name.
> >>> Try one or more of the following:
> >>> *Check the path to make sure it was typed correctly.
> >>> *Select a file from the list of files and folders.
> >>>
> >>> With the choices of End, Debug, or Help.
> >>>
> >>> Can anyone see what I am doing wrong? I am trying to do a "true"
> >>> backup of a document in two different file locations. thanks.
>
>
>