Tables in diagram format

Category: word for developers


PSalvi_Shelke on Fri, 21 Dec 2018 12:35:25

I have a requirement that a diagram as shown in attachment should be drawn in word using C# code.
I tried with creation of tables with specified no. of rows and columns. I could achieved by disabling the borders of cells which should not be visibile(as in diagram). The thing that is blocking is getting the cell height between 2 visible cells so that I can draw vertical line and center of cell(require some way to identify this) so that I can draw horizontal line from cell to the vertical line.
I have searched online help but couldn't get height. The height which we get from Cell(row,col).Height is 999999 which is undefined value(according to word help).
Any idea how this can be achieved?

           |----- c1  
           |----- c2 |--- c3

My account is verified, still I am not able to attach the image, so have written rough above diagram

abc,c1,c2.... are cells

    abc  ----


Kareninstructor on Fri, 21 Dec 2018 13:39:36


For the benefit for those who may want to assist you indicate how you are currently working with this task e.g. Word automation, Open XML for Word and if possible code (using code blocks found in the reply toolbar on the right).

An example (not to your requirements) for Open XML can be found here, search for CreateDocumentWithTableFromArray. MSDN Word table example.

Yuki Lou-MSFT on Tue, 25 Dec 2018 05:30:13

Hi PSalvi_Shelke,

Did Karen's answer resolved your problem?

You can mark it as answer if it helped and please help us close the thread. 

Best Regards,