LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Check if Word is already active?

I pulled up an Excel macro I wrote in my absolute newbie days (not that I'm
too much farther down the road!) that opens a Word doc. It still works, but
now I can see that it needs some tweaking. I use
Dim WD As Object
doc = Fpath & "\" & Fname & ".doc"
Set WD = CreateObject("Word.Application")
WD.Documents.Open doc
WD.Visible = True
Set WD = Nothing
(doc, Fpath, and Fname are all declared as well.)
Besides being late binding, this opens an entirely new instance of Word,
which can do some strange things to me, depending on what I'm doing in Word
at the moment. What I'd really like to do is check to see if Word is
running first; if it is, then open the new doc within the current instance -
if not, then open a new instance. What's the best way to check if Word is
already running?

Ed


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
check active cell column KimR.Hammel[_2_] Excel Programming 2 August 10th 05 09:35 PM
Check if Active Workbook is Empty scantor145[_18_] Excel Programming 1 July 26th 05 03:21 PM
Macro to copy cell data to word document based on an active row? Brian Excel Programming 2 September 16th 04 01:55 PM
Check active sheet not the one with macros Oscar Excel Programming 2 July 30th 04 04:32 PM
Code to check for active worksheet KimberlyC Excel Programming 2 November 5th 03 02:49 AM


All times are GMT +1. The time now is 09:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"