Add rows to a table in a Word template document using VSTO

Hello,

I'm using VSTO and Visual Studio 2005 to build a project that creates MS Word reports from templates (.dot) and data.

So I'm using bookmarks to fill the template document at right places, but I don't know how to fill a table that is defined in the template (only the header row and one blank row are defined).

If I create bookmarks in header cells, how can I then add new rows to the table?

Tanks,
Julien
LVL 2
JulienVanAsked:
Who is Participating?
 
irudykConnect With a Mentor Commented:
Have a look at http://msdn.microsoft.com/en-us/library/2dw39e8e.aspx to see if that is of some assistance.
0
 
RapidDelpConnect With a Mentor Commented:
I'm not sure how to do it in C#, but in VBA you can do:

Sub Macro1()
' Macro1 Macro
    ActiveDocument.Bookmarks("table1").Range.Select
    Selection.InsertRowsBelow 1
End Sub
0
All Courses

From novice to tech pro — start learning today.