thefear
Technical User
- Mar 24, 2004
- 20
Hi,
I'm updating a raft of policy documents with new logos, etc. I've got one word document(Template) open with the new items, and I open each policy document in turn to read and paste into as necessary.
I've written a macro that will save the file I'm working on with a new filename if hasn't done so already. If it has, it keeps the new filename.
If Right(ActiveDocument.Name, 7) = "mft.doc" Then
newname = ActiveDocument.Name
Else
newname = Left(ActiveDocument.Name, Len(ActiveDocument.Name) - 4) & " mft.doc"
End If
ActiveDocument.SaveAs FileName:=newname, FileFormat:= _
wdFormatDocument
End Sub
This macro is saved in the Template I've always got open, and I've created a button that runs the macro that appears in all the documents I have open .
The problem is it saves the new file to the Template's location rather than the location of the policy document that I actually triggered the macro from. It saves the right file, under the right name to the wrong location.
I've tried to find a property of the ActiveDocument that describes file path, but not found one. Can anyone give me a tip?
Thanks
I'm updating a raft of policy documents with new logos, etc. I've got one word document(Template) open with the new items, and I open each policy document in turn to read and paste into as necessary.
I've written a macro that will save the file I'm working on with a new filename if hasn't done so already. If it has, it keeps the new filename.
If Right(ActiveDocument.Name, 7) = "mft.doc" Then
newname = ActiveDocument.Name
Else
newname = Left(ActiveDocument.Name, Len(ActiveDocument.Name) - 4) & " mft.doc"
End If
ActiveDocument.SaveAs FileName:=newname, FileFormat:= _
wdFormatDocument
End Sub
This macro is saved in the Template I've always got open, and I've created a button that runs the macro that appears in all the documents I have open .
The problem is it saves the new file to the Template's location rather than the location of the policy document that I actually triggered the macro from. It saves the right file, under the right name to the wrong location.
I've tried to find a property of the ActiveDocument that describes file path, but not found one. Can anyone give me a tip?
Thanks