Add text at cursor position? 
Author Message
 Add text at cursor position?

When my userform is unloaded the function returns a text string. I need this
text string to be inserted at the current cursor position of the active
document. I tried addbefore and addafter but this is not inserted at the
correct place. Any ideas on how to get this to work?

Thanks for any help
Chris



Wed, 29 Sep 2004 05:09:52 GMT  
 Add text at cursor position?
Hi Chris,

Quote:
> When my userform is unloaded the function returns a text string. I need
this
> text string to be inserted at the current cursor position of the active
> document. I tried addbefore and addafter but this is not inserted at the
> correct place. Any ideas on how to get this to work?

Selection.Text = mystring
Selection.InsertAfter mystring
Selection.InsertBefore mystring

--
Hope this helps.
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.



Wed, 29 Sep 2004 16:56:03 GMT  
 Add text at cursor position?
Hi H313Agf,

Quote:
> When my userform is unloaded the function returns a text string. I need this
> text string to be inserted at the current cursor position of the active
> document.

Selection.Text = szString

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Wed, 29 Sep 2004 17:57:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Text box cursor position when text is selected

2. Need help on VB5 add-in for current cursor position

3. Cursor position in text box

4. insert text at cursor position

5. Mark text from cursor position until next tab sign

6. Positioning the Cursor in the first text box of a User Form

7. Text Cursor Position in document

8. Setting cursor position in combobox text area

9. Text Cursor Position in document

10. Help setting cursor position in a text box

11. Finding Cursor Position In Text Box

12. Maintaining cursor position in text box

 

 
Powered by phpBB® Forum Software