I recorded a macro in Word 2007 but it is not working as intended.
The macro is intended to add the word Remote at a certain line in the document then Protect the Word document with a password against any editing and then save it as 'using the same original name' of the open document into a DIFFERENT folder on the same hard drive. Every document has a unique name that needs to be maintained while 'saved as' to the new folder after protection is added.
The macro works as intended to the extent that it adds the protection to the document but saves it in the same folder where the original copy of the document exists and NOT in the intended folder which is different (C:\Users\pas\Desktop\Uploadable\)
Here is the macro:
Sub ProtectANDSave()
Selection.MoveDown Unit:=wdLine, Count:=10
Selection.TypeText Text:="Remote "
Selection.MoveRight Unit:=wdCharacter, Count:=22
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=" "
Selection.Delete Unit:=wdCharacter, Count:=1
ActiveDocument.Protect Password:="lotus", NoReset:=False, Type:= _
wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=False
ChangeFileOpenDirectory "C:\Users\pas\Desktop\Uploadable\"
strName = ActiveDocument.FullName
ActiveDocument.SaveAs FileName:=strName, _
FileFormat:=wdFormatRTF, LockComments:=True, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
:=False, SaveAsAOCELetter:=False
ActiveDocument.Close
End Sub
Any help will be greatly appreciated.
On another note, I have no knowledge of Visual Basic at all.
Matt