View Single Post
  #1   Report Post  
Posted to microsoft.public.word.tables
Tom Tom is offline
external usenet poster
 
Posts: 61
Default insert new cell in specific table, then populate with text?

I'd like to insert a new cell in a specific table, and then populate
the cell with autotext so that it inserts an image.

I've been trying to figure this out looking at VB code, but am too
novice.

I want the macro to say something like, For tables with style r-note in
row (1,1), insert a new cell before 1,1 and then populate the new cell
with the text "noteicon".

My attempt to code this was something like this:

Sub FormatNotes()

Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
If oTbl.Cell(1, 1).Range.Style = _
ActiveDocument.Styles("R-note") Then
With oTbl

Selection.InsertCells ShiftCells:=wdInsertCellsShiftRight
For Each aBorder In Selection.Borders

[got confused here -- no idea how to populate a specific cell]

End With
End If
End Sub

Can someone help me make this work?

Also, if I want to define the color of the cell borders in a table,
what's the property for that?

Thanks.