LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX and Word

All,

I am in the process of parsing documents and creating a Word 97 document.

This document only contains a table. I was able to successfully create the
table,
change the column widths, and add headers. One of the columns contains comma

delimited variables. I am trying to select the column and then replace the
"," with
. The code snippet below was one of the many attempts to do this:

err = Word_SelectColumn( tableHandle, 3 );
err = CA_VariantSetCString( &vtFindText, "," );
err = CA_VariantSetCString( &vtReplaceWith, "^l" );
err = CA_VariantSetLong( &vtReplace, WordConst_wdReplaceAll );
err = CA_VariantSetLong( &vtWrap, WordConst_wdFindStop );
err = Word_GetProperty( tableHandle, NULL, Word_SelectionFind, CAVT_OB
JHANDLE,
&findHandle );
//Word_FindClearFormatting( findHandle, NULL );
//Word_ReplacementClearFormatting( findHandle, NULL );
err = Word_FindExecute( findHandle, NULL, vtFindText, CA_DEFAULT_VAL,
CA_DEFAULT_VAL,
CA_DEFAULT_VAL, CA_DEFAULT_VAL, CA_DEFAULT_VAL,
CA_DEFAULT_VAL, vtWrap, CA_DEFAULT_VAL,
vtReplaceWith, vtReplace, &status);

Word_FindExecute expects a Find Obj but the call to Word_GetProperty yields
an error.

Any help would be greatly appreciated.

Thanks.

Randy Schmidt
DAQtech, Inc.
0 Kudos
Message 1 of 1
(2,990 Views)