Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

checking for an instance of Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ted - 19 Mar 2005 19:53 GMT
Hi all,

I'm running some VBA code thru Access to open Word and print some documents.
How do I check to see if an instance of Word is already running?

Thanks in advance
Ted
Jezebel - 19 Mar 2005 22:33 GMT
Dim pWordApp as Word.Application (or as Object)

'Retrieve existing instance if any
on error resume next
Set pWordApp = GetObject("Word.Application")
On error goto 0

'Failing that, create a new instance
If pWordApp is nothing then
   set pWordApp = CreateObject("Word.Application")
End if

> Hi all,
>
[quoted text clipped - 4 lines]
> Thanks in advance
> Ted
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.