We have recorded several macros to use for a new letterhead here in the office. We recorded them to document 1 and then saved them as .dot files in Office\Startup. They basically insert a document into the existing document to set up formatting and insert a logo. We saved local copies of the document they insert to the Office\Startup folder as well (as .doc's).
The problem is that they run fine for a while, then they fail with a 5174 "file cannot be found" error. The file they refer to is the .doc file. Closing and reopening Word doesn't fix the problem, but rebooting does.
Any ideas? Could it be the location of the saved docs?
Here is the code for one of them:
Sub LetterheadelecwithDD()
'
' LetterheadelecwithDD Macro
' Macro recorded 11/14/2007 by Dana Dea
'
ChangeFileOpenDirectory _
"C:\Program Files\Microsoft Office\Office\Startup\"
Selection.InsertFile FileName:="LetterheadelecWITHDD.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.Font.Name = "TradeGothic LT"
End Sub
The problem is that they run fine for a while, then they fail with a 5174 "file cannot be found" error. The file they refer to is the .doc file. Closing and reopening Word doesn't fix the problem, but rebooting does.
Any ideas? Could it be the location of the saved docs?
Here is the code for one of them:
Sub LetterheadelecwithDD()
'
' LetterheadelecwithDD Macro
' Macro recorded 11/14/2007 by Dana Dea
'
ChangeFileOpenDirectory _
"C:\Program Files\Microsoft Office\Office\Startup\"
Selection.InsertFile FileName:="LetterheadelecWITHDD.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.Font.Name = "TradeGothic LT"
End Sub