Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I exit a word application and not just close

Status
Not open for further replies.

spruceni

Technical User
May 18, 2007
72
GB
Hi
I have opened a word application and used Access to create a report.

Ihave saved the report and now I want to exit word.

So far I have found .close which will close the file but the blank word application still appears on the screen.
Here is the tail end of my sub

strDocName = strBusManName & "-Summary-" & Format(Now(), "dd-mm-yy")
strDocName = strFilePath & strDocName
ActiveDocument.SaveAs (strDocName)
ActiveDocument.Close

' Set the Word Object to nothing to free resources
Set WordObj = Nothing
DoCmd.Hourglass False

How do I make VBA shutdown Word?

 
strDocName = strFilePath & strDocName
[!]WordObj.[/!]ActiveDocument.SaveAs strDocName
[!]WordObj.[/!].ActiveDocument.Close
[!]WordObj.Quit[/!]
' Set the Word Object to nothing to free resources
Set WordObj = Nothing

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Thank you

I never thought that the word was quit; rather than exit. :)

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top