View Single Post
 
Old 06-09-2014, 06:28 AM
jpb103's Avatar
jpb103 jpb103 is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: May 2014
Location: Thunder Bay, Ontario
Posts: 58
jpb103 is on a distinguished road
Default

You seem to be changing the caption of a content control. Is this intended? It seemed from the description of your problem that you simply wish to paste StrDetails at the location of the bookmark BM2. If you want to move the cursor to a bookmark location, you could use something like this:
Code:
Selection.GoTo What:=wdGoToBookmark, Name:="BM2"
Then, if you want to put that text on the next line after the bookmark, you could do something like this:
Code:
Selection.TypeParagraph
Selection.Range.Text = StrDetails
So if you replace this line:
Code:
ActiveDocument.ContentControls(2).Range.Text = StrDetails
with the three lines I've provided I think it should work.

Last edited by jpb103; 06-09-2014 at 06:40 AM. Reason: more efficient code
Reply With Quote