LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Fonts and formatting Word documents

I am trying to generate and format a Word document using the WordRpt_SetTextAttribute command. Specific font requirements (bold, underline, centre alignment, etc) should apply to various part of the document (i.e. the column titles for a table should be bold, underligned and centre aligned while the data in the following rows should not be bold and underlinged). Creating the bold, underligned, centre aligned column titles is not a problem. Before I write data to the next  cells (using the WordRpt_WriteToNextCell command) I set the font particulars (e.g. WordRpt_SetTextAttribute(dochandle, WR_ATTR_FONT_BOLD, WR_Const_FALSE)  ). When the document is created not all changed font particulars seem to have been used (e.g. the cell content is not underligned (correct) but the font is still bold (incorrect) ) even though I specified the new font particulars before I wrote to the cells.  I am obviously missing something but what ?
 
Regards
 
Erik Wegman
0 Kudos
Message 1 of 2
(2,985 Views)

Hi Erik,

I am not sure what's happening what is happening in your code, but have you taken a look at the wordrpt.prj shipping example?  You can find it by going to Help>>Find Examples and searching for ActiveX.  This example creates a table in Word which sounds just lik you describe your target.  The column headings are bold and underlined but the rest of the text is normal.  Perhaps you can use this example as starting point.

If this doesn't help, perhaps you could post a very small section of code which is producing an unexpected result

Good luck!
Megan B.
Applications Engineering
National Instruments

0 Kudos
Message 2 of 2
(2,963 Views)