LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a Word document in LabVIEW

I would like to open use a Word document as a Help file in my LabView project.  I want it to open when the user clicks on a button.
 
From what I have read, using ActiveX commands seems to be the way to do it, but I'm having real difficulty understanding these commands and the examples listed. It is probably quite simple but I just can't get my head around it. 
 
Can anyone explain how to do it in simple terms.
 
Thanks
BD
 
0 Kudos
Message 1 of 15
(8,632 Views)
which version of Office Word are you using?
0 Kudos
Message 2 of 15
(8,617 Views)
If you're using LV 8 and Office 2003, try the attachment.  If you're using LV8 and other Office, you can also try the attachment, but you may need to go through all the errors and relink all the property & invoke nodes.
 
The attached VI is suppose to open the attached document as Read-Only, wait for you to click on the stop button, then close the document and Word without saving any changes.
 
Hope this helps,
See-Ming
0 Kudos
Message 3 of 15
(8,609 Views)
I'm using LabVIEW 7.1 and Office 2000
 
Regards
BD
0 Kudos
Message 4 of 15
(8,600 Views)
Hmm.. I only have Office 97 and 2003, so not sure if this will work with Office 2000.  Well, try to open the VI (I saved it to previous version 7.1), and if there are broken wires, do the following (see screenshots):
 
1.    right click on Word._Application and go to Select ActiveX Class and Browse (the wording might be different since we're using different version of LabVIEW)
2.1  it might take a while (a few minutes), but a little window will pop up with all the ActiveX libraries (I think all of them) on your computer.  Select Microsoft Word x.x Object Library.  The one on my computer is from Office 2003, so it's 11.0, I think Office 2000 is 8.0.
2.2  check the Show Creatable Objects Only box, select Application from the list, and click ok
3.    If there are still broken wires, go through each property and invoke nodes and reselect the function (functions are slightly different in different version of the library)
4.   If there are still broken wires, click on the broken arrow and see what's wrong, if the error says something like "contains unwired or bad terminal", double click on the error to go to the problematic node, and create a constant on each empty input (sometimes older version library requires more parameters..)
 
Hope this will work...
See-Ming
 
0 Kudos
Message 5 of 15
(8,596 Views)

Thanks for the help.  I've tried your example but unfortunately it only opens up Word and not the actual document.  I've tried it with different documents and had the same result.

Any idea why this may be happening?

Thanks

BD

0 Kudos
Message 6 of 15
(8,582 Views)

you probably need to download and intall the service release from Microsoft.  Here's one of them, I'm not sure if Office 2000 has 1 or 2 (Office 97 has 2 service release, but I think you only need the first one to run activeX with LabVIEW):

* if the link doesn't work, go to Microsoft and search for Office 2000 service release *
http://www.microsoft.com/downloads/details.aspx?FamilyID=af6c8d03-7633-45b4-ab96-795ee656f2a2&Displa...

this should be able to solve the problem with the document not opening (it did for my Excel 97 ^_^)

See-Ming

0 Kudos
Message 7 of 15
(8,563 Views)
Any reason why I would be having the same problem ( Word opens w/o the actual document being displayed) with Office XP ??  LV7.1
0 Kudos
Message 8 of 15
(8,380 Views)
do you need it to be in word. if you don't then it is a lot easier to do just open the txt file and read all of the data then put the data in a string indicator
0 Kudos
Message 9 of 15
(8,377 Views)
Here's my 2 cents.
 
Word is already set to open the document in windows so why not just use the system exec VI to open the document. this way it will always open with word. then you just close it when you are done. i do this all of the time with help files and such.
 
Here is the VI I created to do this.
 

Message Edited by Jhoskins on 10-11-2006 01:26 PM




Joe.
"NOTHING IS EVER EASY"
Message 10 of 15
(8,368 Views)