I've done my Usenet homework on this, but still can't find the proper
syntax for this:

I have a UserForm open, with some text stored in the "txtInsert" field
in the form.

What is the syntax to attach to a command button on the form to insert
the value of txtInsert into the document at the current cursor
position?


TIA

Re: Insert text from UserForm into current cursor position by Perry

Perry
Sat Jan 24 21:26:49 CST 2004

Use the below in click event of yr commandbutton

Selection.Range = Me.txtInsert
Unload me

Krgrds,
Perry

"Charles Warner" <rathernot@havemail.com> wrote in message
news:gt86109c1ocfr26hotd47ern3qu3fll3ih@4ax.com...
> I've done my Usenet homework on this, but still can't find the proper
> syntax for this:
>
> I have a UserForm open, with some text stored in the "txtInsert" field
> in the form.
>
> What is the syntax to attach to a command button on the form to insert
> the value of txtInsert into the document at the current cursor
> position?
>
>
> TIA



Re: Insert text from UserForm into current cursor position by Jay

Jay
Sat Jan 24 23:09:11 CST 2004

Charles Warner <rathernot@havemail.com> wrote:

>I've done my Usenet homework on this, but still can't find the proper
>syntax for this:
>
>I have a UserForm open, with some text stored in the "txtInsert" field
>in the form.
>
>What is the syntax to attach to a command button on the form to insert
>the value of txtInsert into the document at the current cursor
>position?

Selection.Text = txtInsert.Text

That statement will leave the entire insert highlighted. If you want
the cursor to move to the end of the insert, so that more stuff can be
inserted without overwriting, follow up with the statement

Selection.Collapse wdCollapseEnd


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word

Re: Insert text from UserForm into current cursor position by Charles

Charles
Sun Jan 25 06:32:51 CST 2004

Thank you both ... simple enough when you see it.

I've almost got this project together ... many thanks to those in this
group who pointed the way at each turn ...

I made the mistake of buying a book on Word a few months ago, not
realizing until I went to use it *seriously* that it was a poor
choice.

Could you recommend one that you consider the best? (I'm an 'ol MS
Access programmer ... know a bit about that, but making the transition
into Word's Object Model has been confusing - mostly *me* I guess, but
the book hasn't been much of a help.)

Best,

Charles


On Sun, 25 Jan 2004 02:13:06 GMT, Charles Warner
<rathernot@havemail.com> wrote:

>I've done my Usenet homework on this, but still can't find the proper
>syntax for this:
>
>I have a UserForm open, with some text stored in the "txtInsert" field
>in the form.
>
>What is the syntax to attach to a command button on the form to insert
>the value of txtInsert into the document at the current cursor
>position?
>
>
>TIA