Question Tables and Bookmarks in Word

Vandella

New member
Joined
Nov 1, 2012
Messages
1
Programming Experience
Beginner
Hey guys, im a Noob to this site, and im after some help if possible, i have a word template with a various amount of bookmarks.. now one of these bookmarks is where a table will be inserted, now i can get the table to display using the below method and all works ok but what im after is to be able to place the table at the bookmark "table1" i cant seem to find a right way to access this.. im not sure that im using the range or the bookmark correctly.. this is the code that displays the table in the document but not where id like it to be..

objectstart=450;
objectend=500;

Word
.RangetableLocation=this.Range(refstart, refend);

this.Tables.Add(tableLocation, 2, 2, refmissing, refmissing);

Word
.Tabletable=this.Tables[1];

table.Range.Font.Size=10;
table.Range.Font.Name="Georgia";
table.Range.Font.Bold.Equals(true);
table.Range.Font.ColorIndex=Word.WdColorIndex.wdBlue;
table.Range.Cells.Shading.Texture=Word.WdTextureIndex.wdTexture10Percent;
table.Range.Cells.Shading.ForegroundPatternColorIndex=Word.WdColorIndex.wdBlue;
table.Range.Cells.VerticalAlignment=Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table.Rows.SetHeight(RowHeight: 24, HeightRule: Word.WdRowHeightRule.wdRowHeightAtLeast);
table.Columns[1].SetWidth(ColumnWidth: 170, RulerStyle: Word.WdRulerStyle.wdAdjustNone);
table.Columns[2].SetWidth(ColumnWidth: 310, RulerStyle: Word.WdRulerStyle.wdAdjustNone);
table.Borders.InsideLineStyle=Word.WdLineStyle.wdLineStyleNone;
table.Borders.OutsideLineStyle=Word.WdLineStyle.wdLineStyleNone;
;
 
Back
Top Bottom