PDA

View Full Version : Solved: Macro doesn't work in Word 2003



shekhu
03-28-2007, 05:52 AM
This is a macro to save the compared version(with unedited document) of a document that is opended from the server after editing at D:\Edited with prefix "Compared" + active document name. This works fine in Word 99 and 2000, but when I use this macro in 2003, it saves the document at D:\Edited as "Compared + document1" ,i.e., instead of active document name it puts document1. I dont know why, please help me out. :think:

Sub C2()

Dim editedFileFullName As String

ActiveDocument.Save

editedFileFullName = ActiveDocument.FullName

ActiveDocument.Compare Name:="D:\Unedited\" & ActiveDocument.Name
ActiveDocument.SaveAs "D:\Edited\Compared " & ActiveDocument.Name

Documents.Open editedFileFullName

End Sub

lucas
03-28-2007, 06:27 AM
Try this...changed a couple of things:
Sub C2()

Dim editedFileFullName As String

ActiveDocument.Save

editedFileFullName = ActiveDocument.Name

ActiveDocument.Compare Name:="F:\Temp\" & ActiveDocument.Name
ActiveDocument.SaveAs "F:\Temp\Compared " & editedFileFullName

Documents.Open editedFileFullName

End Sub

shekhu
08-12-2015, 02:46 AM
This macro is still doing other way round. Comparing unedited with edited, please suggest.