Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am currently using Interop.Word to draw tables for a document.
I am looking to draw only the outside border for a set of cells (e.g. R1C1 to R2C3)
I roughly know how to draw a full outside border around one cell.

I am hoping that I can just call something to draw the border around the range of cells.
Worst case scenario that I am looking at is drawing the up, down, left and right borders individually.

Any advice is appreciated.

What I have tried:

I know I can set the border for a cell by calling the outsidelinestyle code.
C#
Word.Cell wrdCell = wdTable.Cell(1, 1);
wrdCell.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle;
Posted
Updated 31-Jul-19 4:07am

1 solution

One creates (longer) "borders" by only drawing one side of a set of contiguous cells; unless one uses a "border" CONTROL that can host "child" controls / cells.

e.g. 2 x 2 cells would require "8" side "drawings" for a border. (Thickness(1,0,0,0); etc.)

You can build WYSIWYG data entry forms up from that. Or use "line" controls / overlays.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900