I need to rename a Word doc using VBA in Access. I have been able to open the existing file and save as the new name,
however I am left with the original doc.
Is there a way to simple rename the doc or to delete the original?
Bill
Code:
If strAgent <> Me.Combo15 Then
Set WordInst = CreateObject("word.application")
WordInst.Documents.Open ("C:\Access\Folder1\" & strAgent & ".doc")
WordInst.ActiveDocument.RenameAs ("C:\Access\Folder1\" & Me.Combo15 & ".doc")
WordInst.Visible = True
WordInst.Quit
Set WordInst = Nothing
End If
Is there a way to simple rename the doc or to delete the original?
Bill