NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert Sequence file documentation from TXT or HTML to MS Word ?

Hello, I would like to modify a DocSupport.prj which in default generate only TXT or HTML to support MS Wors *.DOC. I have already change the dialog (add *.doc filter..), that was simple. But the major problem is how to convert the output from doc.c to some *.doc file. I found somewhere here Word9 ActiveX  Instrument  for CVI, but I don't understand, how  the CVI gets informations about the steps etc.  from *.seq file for another use. The original code in doc.c is quite hard to understand it quickly. Thanks for help.
0 Kudos
Message 1 of 4
(4,794 Views)
Hi Pet007,

You should be able to just change the file it saves to's extension to .doc. You'll notice there is a define for txt, you could either change this to doc or if you still want to be able to use txt, create a new define and use this. If you do this you'll need to also add a define above (as you see it defines an integer for each different format type and uses those throughout the program as well). That should give you a good starting point for modifying this code. Unfortunately it is quite extensive to actually accomplish this, or else I could give a step by step guide, but it is rather long. But you should be able to get it working from this. The reason this should work is because Microsoft Word (.doc) files understand plain text just like .txt files. However, if you want to add formatting (fonts, bold text, etc) you would need to use the ActiveX Instrument for CVI which just access the ActiveX server from Microsoft. For more information about ActiveX in CVI visit the following link.

Using LabWindows/CVI as an ActiveX Automation Controller to Control Automation Servers

Also, this link gives an example of using Excel with CVI through ActiveX, which may give you some useful information about doing this type of thing.

Embed Excel ActiveX Documents on a CVI Panel

For more information on using Word's ActiveX Server, check out the following Microsoft Portal.

Word Developer Portal

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 2 of 4
(4,771 Views)
Thak you for your reply. Unfortunately I have to use an existing DOC template with tabs, bolds etc., so using of ActiveX is necessary for me. I have already downloaded from NI support word200.zip. This is an example of using Word in CVI (there is word2000 instrument), so I thing, this is enough for me. But the biggest problem for me is to understand, how exactly works "docgen.seq" and "docgen_html.seq" for ex. I quess, I will need to create "docgen_doc.seq" and in "doc.c" create functions for handling with MS Word (by using Word2000 instrument). Is this the right way to do that ?

0 Kudos
Message 3 of 4
(4,764 Views)
That's correct, in order to modify it you would need to add those pieces (unless you just overwrite the one of the other formats).

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 4 of 4
(4,749 Views)