HLD920 was telling us:
HLD920 nous racontait que :
> I have attempted to create a macro that is described in Graham Mayor's
> instructions. However, once I have the macro saved, by following those
[quoted text clipped - 15 lines]
> Anybody's help would be appreciated on how to get this issue
> resolved. Thank you very much.
What code are you using?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
There is nothing in the macro that will cause this behaviour, but once Word
crashes it leaves a raft of temporary files which make things worse.
Deleting normal.dot is not the issue, but deleting its lock file - see
http://www.gmayor.com/what_to_do_when_word_crashes.htm
I assume that the backup location you are saving to exists on the PC and
that you are not saving the duplicate to removable media as warned against
on the web page? http://www.gmayor.com/automatically_backup.htm
If the problem persists - see
http://word.mvps.org/FAQs/AppErrors/ProbsOpeningWord.htm

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I have attempted to create a macro that is described in Graham Mayor's
> instructions. However, once I have the macro saved, by following those
[quoted text clipped - 15 lines]
> Anybody's help would be appreciated on how to get this issue
> resolved. Thank you very much.
HLD920 - 06 Nov 2006 14:01 GMT
I will try this. Thanks. The backup location is actually a network location
that I would like to put the backups to in case something happens with my PC.
I will reply if the instructions you provided help. Thanks again!
> There is nothing in the macro that will cause this behaviour, but once Word
> crashes it leaves a raft of temporary files which make things worse.
[quoted text clipped - 27 lines]
> > Anybody's help would be appreciated on how to get this issue
> > resolved. Thank you very much.
mwoodward@grandecom.net - 20 Nov 2006 17:40 GMT
Graham, I am using your macro and it's great! One question. I save to
my hard drive and use your macro to also save to a folder on the
network. I noticed that it will store the document as a separate
document that has the same name as the original that is stored there.
In other words, I open a document on the hard drive, let's call it File
1. I have already stored it on the network previously. When I open
File 1 from my hard drive and work on it, when I use the macro, it will
save File 1 as a separate document than the File 1 that already exists
in the network folder. So then there are two File 1 documents, but
only one has the recent edit. Is there any way to amend the macro so
that it will save it as the original file if it already exists? Thanks
so much.
Matt
Graham Mayor - 21 Nov 2006 05:51 GMT
The macro simply saves the documents in two locations. However the second
location has "Backup " in front of the filename. If you want it to overwrite
an existing file remove the "Backup " text from the line
strFileB = "D:\My Documents\Word Backup\Backup " & strFileA
ie
strFileB = "D:\My Documents\Word Backup\" & strFileA
"D:\My Documents\Word Backup\" being your network location.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham, I am using your macro and it's great! One question. I save
> to my hard drive and use your macro to also save to a folder on the
[quoted text clipped - 11 lines]
>
> Matt
mwoodward@grandecom.net - 22 Nov 2006 03:11 GMT
Graham, thanks for the reply. I have already removed the "backup" text
from the line so that the file would have the same name as the files
that already exist on my hard drive. I copied all of the files from my
hard drive to the network folder, but if I open one from the hard drive
and then save it using the macro, it will save that file as a new one
on the network with the same name as the original that already exists.
I might be confusing things so I will say it a different way. Is there
a way to alter the macro so that it will check to see if that filename
already exists, and then will replace it with the modified one?
Thanks.
Matt
Graham Mayor - 22 Nov 2006 07:38 GMT
What I think you want is a warning if the backup file already exists?
The following will do that - once!
Change strPathB to your backup location
Sub SaveToTwoLocationsB()
Dim strFileA, strFileB, strPathA, strPathB, fso
ActiveDocument.Save
strPathA = ActiveDocument.Path
strFileA = ActiveDocument.Name
strPathB = "D:\My Documents\Test\Merge\"
ChangeFileOpenDirectory strPathB
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(strFileA) Then
ActiveDocument.SaveAs FileName:=strFileA
Else
strFileB = InputBox(strFileA & _
" already exists in the backup location. Rename?", , strFileA)
ActiveDocument.SaveAs FileName:=strFileB
End If
ChangeFileOpenDirectory strPathA
ActiveDocument.SaveAs FileName:=strFileA
End Sub
> Graham, thanks for the reply. I have already removed the "backup"
> text from the line so that the file would have the same name as the
[quoted text clipped - 8 lines]
>
> Matt
mwoodward@grandecom.net - 28 Nov 2006 01:03 GMT
Graham, this appears to have done the trick. I sure appreciate your
helpfulness in providing this information. Thanks very much.
Matt