LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change color of font after search/find

Hi
 
I would like to know how to change the searched word.
 
I create a Word Report using Report Generation Toolkit. I want to search for a word in this report and change the color of this searched word.
 
I tried using the Find and Replace and modified it but when my vi run to this subvi, LabVIEW hangs and crashes. Could anyone tell me what is wrong with my vi or could anyone tell me how to change the color of the searched word??
 
Thank you & Regards
Lee
0 Kudos
Message 1 of 5
(2,978 Views)
I think the error is because you are closing your references in the wrong order.  If you are using Office 2007, that could also be a problem.  I discovered and documented a bug regarding the find and replace VI and Office 2007 (LabVIEW closes without warning).

I got this working in Office 2003.  See the attached VI.  It edits the replacement property's font's color prior to replacing the string.  You can even wire in the color to a top input terminal.

Trey B
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(2,949 Views)
Hi Trey,
 
Thank you for your reply. However, I got an error when using that in an example vi [Generate Report From Template (Word).vi]. I have attached the printscreens of the error and the version of Word I am using. I believe I place the Word Find and Replace vi at the wrong place but I am not sure where I should place it. Could you help me on this??
 
Thank you & Regards
Lee
Download All
0 Kudos
Message 3 of 5
(2,937 Views)
Lee,

The problem is likely something to do with ActiveX.  Microsoft keeps changing ActiveX APIs in their releases of their software, and the varying APIs cause problems with our software.  Here's a couple KBs about it:

http://digital.ni.com/public.nsf/allkb/83211E3A088D0C3786256DB700621FE8?OpenDocument
http://digital.ni.com/public.nsf/allkb/1C025F018CB5761686256C56007DD258?OpenDocument

The problem could very well be on our end as well.  When I created the color version of the VI, I had to uninstall my 07 Office and install 03 because that VI would crash LabVIEW.  Unlike your error, I didn't get a popup, it just closed.

As for where I am placing it, I copied the Sample Report (Word) example and placed it near the end of the code.  See the attached image.

0 Kudos
Message 4 of 5
(2,911 Views)

Hi Trey,

Thanks alot. It works great in that example [Sample Report (Word) example]. I do not understand why I can't seems to get it working in the other example [Generate Report From Template (Word).vi].

Anyway, thanks alot

Regards
Lee

0 Kudos
Message 5 of 5
(2,898 Views)