LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add frames to a table generated with wordreport?

Hi!

If a add a new table into a word document with the wordreport instrument the table has no frames. If I choose the page preview I only can see the values of the cells, but no frames.

Is there a possibility to add the frame to the table with the wordreport instrument or with ActiveX?

Thanks
Thomas
0 Kudos
Message 1 of 4
(2,976 Views)
Dear Hamsti,

unfotunately there is no chance to set a frame with the wordreport functions. Therefore you have to go the hard way using the ActiveX interface.

keep going,
Eye-catcher
Message 2 of 4
(2,953 Views)
Where can I find information about ActiveX interface? This is my first time using this interface and I don´t know anything about ActiveX.

Thanks,
Thomas
0 Kudos
Message 3 of 4
(2,937 Views)
Hello hamsti,

The word report instrument is built using the Microsoft Word Object Library (and is automatically loaded when you use Word Report). One function in the object library that will add borders around your table is the FmtAllBorders() function.

I would suggest taking a look at the word2000demo shipping example located at ..\National Instruments\CVI71\samples\activex\word\word200demo.prj.

If you run the example, the lines, in the AddTableToDoc callback, that adds frames to the created table are

caErrChk (Word_GetProperty (columnsHandle, NULL, Word_SelectionBorders, CAVT_OBJHANDLE, &bordersHandle));
caErrChk (FmtAllBorders (bordersHandle, Word_BorderLineStyle, WordConst_wdLineStyleSingle));
caErrChk (FmtAllBorders (bordersHandle, Word_BorderLineWidth, WordConst_wdLineWidth150pt));

So first, you need to get a handle to the border around your columns, then set the property for the border. I would suggest taking a look at the AddTableToDoc callback for more information.

Hope that helps.
0 Kudos
Message 4 of 4
(2,927 Views)