
insert text at cursor position
Hi Jody,
If you want to add your text after the selection in the document, use :
selection.InsertAfter text:= CBmergecodes.Text
if you want to replace the selection, use:
selection.Text = CBmergecodes.Text
Hope this helps,
regards,
Astrid
For direct access to all Microsoft newsgroups:
Quote:
> Is this possible? I have a custom combo box where the user selects a
custom
> mail merge code and clicks a button to insert that code in the document.
I
> want to insert the text of the combo box where the cursor is currently
> located in the document. However, the following line of code only inserts
> my text at the beginning of the document.
> ActiveDocument.Content.InsertBefore Text:=CBmergecodes.Text
> What am I missing? It seems like there should be a simple way to do this.