o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Detecting, getting and piloting MS Word from a VB app -

In a VB6 application, I create an MS Word instance and pilot this application directly from the VB application. Using for that the following code :

Dim objWord As Object
Dim objBasic As Object
Set objWord = CreateObject("word.application")
Set objBasic = CreateObject("word.basic")
With objBasic
.FileNew Template:=("c:\template.dot"), NewTemplate:=0
.Insert "this is a line into word from VB app"
.InsertPara
....
....
End With


But I would like to use, in the same way and if it is present at running time, an already loaded instance of MS Word (for example previoulsy launched by the user).

I know how to test if an instance of MS Word is running, by using FindWindow("OPUSAPP", 0). But my problem is : how can I get, catch and pilot an existing instance of MS Word the same way as described here above (using the Word.Basic commands). I tried several ways with GetObject... but I was never able to catch this instance... in fact in my last attempts it creates always a new instance of Word. Maybe someone can give me some tips. Thanks !

 

Detecting, getting and piloting MS Word from a VB app -
In a VB6 application, I create an MS Word instance and pilot this application directly from the VB application. Using for that the following code : Dim objWord As Object Dim objBasic As Object Set objWord = CreateObject("word.application") Set objBasic = CreateObject


Detecting version of MS Word -
How can one, programmatically check the installed version of MS Word with vb code other than the Version property of the application object. For my particular application, this detection needs to be done by an executable that has nothing to do with Word. Does anybody know how this is d


[2005] Detecting hardware -
Just got a couple of questions about detecting a machines hardware. I've been asked to write an application that detects the users hardware, kind of like an installer that detects system requirements. How would I go about detecting a users CPU and it's frequency and how would I g


Detecting if Word is loaded -
Hi. I'm trying to use Word's Spellchecker in my app. If Word is already loaded, I won't load a new instance, I'll just use the spellchecker. If it isn't loaded, I would like to load Word. How do I figure out if it is loaded? I'm trying to use the FindWindow API but it's no


Detecting if a Word doc is open -
I'm looking for a way to look for open Word docs from VB. I have a program that opens and closes word documents, and at times I need to make sure there are no open docs before triggering an event. I tried simply using appWord.Documents.Close, but Word doesn't like that if the open docu


Detecting if Word2000 is running -
Hi All, I thought that using : Set msword = GetObject(, "Word.Application") Would cause my msword object to latch onto the existing app if it was running otherwise an error 429 would get thrown and I could then use : Set msword = CreateObject("Word.Appli


detecting if Excel and Word has finished their print jobs -
Hi all, I have a vb app that prints a list of word and excel documents. The printing works just fine, but I need to know when Word and Excel has finished the print jobs I sent to them, in order to close the applications(word and excel). If I use the Application.Quit methode, the


Detecting if Word has password to open -
Hi, Is it possible to detect if a word document has a password to open it at the time of opening the actual document? I have a java application which is using jacob (java com bridge) to open word documents. If a document has a password to modify it is possible to open it in read-on


Detecting MouseOut() -
Not sure if this is in the right place but I need help detecting whether the mouse has left a control, something like a MouseOut function or similar to. Thanx in advance if u can help


Detecting mouse button status -
I thought this would be easy, but i've searched around a bit and I can't seem to come up with an answer. How would you go about detecting the state of the mouse buttons.. not just for your own application, but for windows in general?


i would like some feedback -
our class is "piloting" a book for c++ called "C++ For You++" and i would like to get some feedback on what you guys think of it, me and some others in my class think its horrible because it uses things like apvector instead of real arrays like you would use in real


Detecting an instance(s) of MS Word in Memory... -
[quote]Originally posted by Nitro [b]Go to this site. http://forums.vb-world.net/showthrea...threadid=25427 You need to change the word "Excel" to "Word" in the code below. I like to ask you for your help too. I will be making a project soon dealing with PDF


Detecting a modem connection -
How do I go about detecting if a modem is connected? I just need the general detection code... Thanx for your help, Squirrelly1


detecting cd-burner -
How would I go about detecting if a users PC has a cd-burner? If they do, is it possible to build a simple interface that would allow the user to burn a cd?


Detecting Dial Up Connection -
Hi, Can u help me out in detecting the dialup connection(s) in the machine. Regards venki


Detecting Headers -
Is it possible to detect if a header exist in a word document? And if so what type of properties can you get on that header (i.e size, location,...). This would be in Office Xp. Thanks


Connection Detection Convention -
I have two questions regarding detecting various types of connections. First of all, I am using InternetOpenUrl method of detecting an internet connection. I am opening a site that is very likely to be up, such as yahoo.com, but the problem is that it takes a very long time to detect i


Detecting MD5 -
Hi I got a keylogger in my sys32. Here is what it do. 1.Make random sys files and copy itself 2.Make logs of itself so it still there after sys restore 3.Keylogs 4.Spreads through MSN I was stump for an hour then I had an idea xD Viruses can't change thier MD5 so I should try


[2005] Detecting a single word nearest the selection start of a rich text box -
Hi, In my application, I have a list of 'valid' keywords, (IE, Hello, Peace, Good) When I'm typing I want to set the text of my Search TextBox to the letters being typed... So if I type "Hel" it will send it to the textbox, which in turn sorts through the words until on


Detecting in-use documents -
Thought this would be easy, but it's not... I'm opening a document with Word through VB automation: wrdApp.Documents.Open filename, etc. But I cannot figure out how to tell if someone else already has it opened. Currently, I have to check to see if the caption property has th


Detecting if Textbox needs a scrollbar -
Hey guys, I just had an issue on how I would go about detecting whether or not a textbox requires a scrollbar when the text goes out of view. I know it does this automatically, but I would like to be able to try and do this manually. Does anybody know?


Detecting CPU Temperature -
How would I go about detecting the CPU's Temperature? Is there any calls to dig this up?


detecting word "private" -
Thanks for all the help so far everyone the first part worked out really well! I have another rich text box that you can type directly into, I want it to detect whenever the word "private" is entered, change the font color of "private" to blue and return the curs


Detecting if a menu is open -
Hey everyone... I wanted to know how I would go about detecting if a menu is open or not. I'm sure there must some kind of API call for this purpose? Thanks a lot. JMik


detect when Word's .PrintOut command has finished -
I am using the MS Word object library, and I am printing out large mail-merge documents via the .PrintOut command. I then need to close the document printed, but the problem is, if I issue a .Close command to the document, the print also terminates. Is there a way of detecting when a .


Detecting letters in a text box -
Hi, I would like to know how to detect what letter is 5 spaces across in a label. For example, in a label called lblLetters with a caption of ‘Visual Basic’ the result would be ‘l’. It would find ‘L’ because ‘L’ is five spaces to the right from the start of the word.


Help for detecting border (BW image) -
I try to detect border from BW image. My problems is it only works if the image was pretty clear. (especially at border area). Look at my project.. i had a trouble in detecting picture 4 and 5. Would u help me find an efficient/correct way to do that.... pleaseee....


Detecting Office Apps [Solved] -
I was wondering if it was possible to detect Office Apps (Excel Word etc) and the version (2000, ,2002, 2003 etc.) Been pondering this but never really searched around, seemed like a common enough situation that hopefully someone on the forums would have experience with.


Detecting mouse click on other application -
I am trying to write a test program to detect the activities on another application. Such as user input on the textfield, mouse click on buttons and activation of dialogue box. Is it possible using the default WIN32 API detecting the messages send from the windows? How could i


Detecting IE Memory Leaks -
while browsing "the web", i found this tool for detecting memory leaks in IE that i thought some people might find useful. The code is released under a BSD license.


Detecting websites... -
Is there an API for detecting websites and when they are visited?


Select MS Word Object Library in project -
Word.Basic will always reference the latest version of MS Word. It also appears that the two interfaces are binary compatible because they both have the same Class IDs. (I only have Word 2000 on my system, but Word.Basic, Word.Basic.8 and Word.Basic.9 have the same CLSIDs, plus micros


searching for word in word doc -
I want to write code so that if a word in a variable in the vba behind word is equal to a word in the word document, it changes that word in the document to bold. How would i do that?


Detecting Cursor position and dynamically adding RTFs.. Please Help -
I need to know how to detect my cursor on an RTF. When the cursor reaches the end it will load up a new RTF and the overflowing text will move onto the new RTF. If you don't know what i mean, Check out MS word and get to the end of the page and a new page will show up. That is what


Detecting when a monitor goes into energy saving mode. -
If you have the energy saving features for a monitor turned on under Display properties, is there anyway of detecting when the monitor is powered down? and then told to wake up? thanks Das Shrubber


Detecting Screen Changes -
I am working on a remote desktop application and I'm a VB6 programmer myself. But I was wondering if its best to use C++ for detecting any changes in the screen since its more of a low-level labguage? I was thinking of having someone write this as a DLL and be able to use it in my VB6


MIDI input... -
Anyone have an example of detecting a sound card's MIDI input in VB? (detecting when the MIDI controller is pressed and what not...)


Detecting if a form is loaded -
What's the best way of detecting if a form is loaded? This has to include if it's loaded but hidden ala form2.hide


Detecting Other Applications -
I have a form that when it is visible in my program I need it to be Ontop( No problem, I have that already) but, when Other applications are brought up, I do not want them to be under my form. Is there a way to determine if a program is active, and if not, then make the form not top mo


Detecting values in a game -
There is a game in which you have to click a button to roll numbers for your statistics. How would I go about detecting what these numbers are and then automatically clicking the reroll button if the statistics aren't high enough? Thanks