Hi all,
I have a table in a Word template with bookmarks in a number of the cells.
When a document is created from the template, there is some VBA code that should insert text in the cell where a certain bookmark is.
However for one cell this is not happening. Instead, the text is being inserted in the top left (i.e. first) cell of the table (where there is no bookmark and therefore no text should appear).
Does anyone know why this might be happening? I have provided the code below:
[VBA]
Public Sub InsertTextAtBookmark(ByVal sBookmark As String, _
ByVal sText As String)
ActiveDocument.Bookmarks(sBookmark).Select
Selection.SelectCell
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeText (sText)
End Sub
[/VBA]
In most cases this does not happen, only on a couple of the templates.
Any info is appreciated, let me know if you need any other info.
Thanks,