ISO refined VBA for pasting excel cell content to bookmark in a protected template.
'using:
With objWord
.ActiveDocument.Bookmarks(BkMk).Select
.Selection.Paste 'after Excel...Cells(x,y).copy
End With
The Bookmarks.Select places the doc's cursor at the beginning of the field, but does not highlight the whole field (as is would if you went to the field manually). As such, the paste forces the original field space to the right, so that the resulting field.result is "MyName....spaces...".
ISO some code change like adding 'ctrl+shift+end' to highlight the entire field before pasting.
'using:
With objWord
.ActiveDocument.Bookmarks(BkMk).Select
.Selection.Paste 'after Excel...Cells(x,y).copy
End With
The Bookmarks.Select places the doc's cursor at the beginning of the field, but does not highlight the whole field (as is would if you went to the field manually). As such, the paste forces the original field space to the right, so that the resulting field.result is "MyName....spaces...".
ISO some code change like adding 'ctrl+shift+end' to highlight the entire field before pasting.