How to SaveAs a word doc which is already open
My application opens up a word document in preview mode. I'm trying to close the preview mode, then it opens the file in a compatibility mode. I need to save as the file in a folder.
I've tried like this:
Sys.Process("WINWORD", 2).Close - This closes the preview mode
If (Sys.Process("WINWORD").Exists) Then
Set WordObject =Sys.OleObject("Word.Application")
WordObject.ActiveDocument.SaveAs("C:\work.doc")
End If
I get an error in the 'WordObject.ActiveDocument.SaveAs("C:\work.doc")' statement 'This command is not available because no document is open'
How can I handle this? Any help would appreciate.
Thanks, tristaanogre for the reply. That didn't work, unfortunately. I have managed to find the temp file in a folder and take a copy of that as a solution to my issue.