T
Tom
I have two macros that I can't quite seem to combine. I want the macro
to add a new cell on the left of all Note style tables, and then to
write the word "noteicon" in the new cell.
This macro adds the text "noteicon" in the first cell of tables that
have the "Note" style.
Sub AddText()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
If oTbl.Cell(1, 1).Range.Style = _
ActiveDocument.Styles("Note") Then
With oTbl
.Cell(1, 1).Range.InsertAfter "noteicon"
End With
End If
Next oTbl
End Sub
This macro adds a new row in the first table.
Sub AddCell()
If Selection.Cells.Count = 1 Then
Selection.InsertCells ShiftCells:=wdInsertCellsShiftRight
End If
End Sub
Could someone show me how to combine these two macros into one? I want
the AddCell macro to only add a cell in "Note" table, and then to write
the word "noteicon" in the new cell. I've been trying to figure this
out for days, but haven't been successful. Thanks for any help.
to add a new cell on the left of all Note style tables, and then to
write the word "noteicon" in the new cell.
This macro adds the text "noteicon" in the first cell of tables that
have the "Note" style.
Sub AddText()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
If oTbl.Cell(1, 1).Range.Style = _
ActiveDocument.Styles("Note") Then
With oTbl
.Cell(1, 1).Range.InsertAfter "noteicon"
End With
End If
Next oTbl
End Sub
This macro adds a new row in the first table.
Sub AddCell()
If Selection.Cells.Count = 1 Then
Selection.InsertCells ShiftCells:=wdInsertCellsShiftRight
End If
End Sub
Could someone show me how to combine these two macros into one? I want
the AddCell macro to only add a cell in "Note" table, and then to write
the word "noteicon" in the new cell. I've been trying to figure this
out for days, but haven't been successful. Thanks for any help.