Creating a Table in Word c#

 Word.Table tbl = ThisDocument.Tables[1];
tbl.Range.Font.Size = 8;
tbl.Range.Font.Name = “Verdana”;

Object style = “Table Grid 8”;
tbl.set_Style(ref style);
tbl.ApplyStyleFirstColumn = false;
tbl.ApplyStyleLastColumn = false;
tbl.ApplyStyleLastRow = false;

// Insert header text and format the columns.
tbl.Cell(1, 1).Range.Text = “Name”;

Word.Range rngCell;
rngCell = tbl.Cell(1, 2).Range;
rngCell.Text = “Size”;
rngCell.ParagraphFormat.Alignment = 

rngCell = tbl.Cell(1, 3).Range;
rngCell.Text = “Modified”;
rngCell.ParagraphFormat.Alignment =


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s