Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow user to move cursor then insert text

Status
Not open for further replies.

nochoice

Programmer
Jun 17, 2003
72
CA
Hey everybody,

Here is my next problem:

-My WORD doc contains a list of titles.

-When adding a new title, the user presses the 'Add new title' button

-A macro configures several parts of the file etc......

-now the user needs to decide where to put the title.

- what I would like is a message box to appear and say something like 'move cursor to desired position, then click OK to add title'. My poblem is when the MsgBox pops-up I can't do anything to the document until I close the MsgBox.

My Question is:
Can I have a MsgBox pop-up, remain on top, allow the user to move the cursor within the document, then when the user clicks OK for the macro to continue?

If this is not possible, can I use an onkeypressed type of function, such that when Ctrl+g, for example, is pressed the title will be added (the script continues).

My code is on the 'Add title' button.

Any other suggestion would be appreciated........
Thanks
 
Im not aware of any way to be able to use a vba application while you have a msgbox running. It may be possible with api calls and getting the handle of the word window...but even then im not sure. Why not just have a mouse move event and have it execute after the message box was closed, where the user clicks on the screen you can have the title pasted there. Is this possibly what your looking for?
 
I would suggest your Keyboard thought.
Although, what I would do is write the macro that I needed, then assign a Keyboard Shortcut to the macro. Then just be sure to make your users aware of the Shortcut.
Your message box could say something like:
"move cursor to desired position, then choose "ctrl+A" on your Keyboard to add the Title."

********************
What's the best way to get the answers you need?? See FAQ222-2244 for details!
 
Thanks for your help,

What I've decided to do is open another document with its toolbars disabled and resize both windows (so I have a split My main doc on the right and the new doc with toolbars disabled on the right). The doc on the right has controls - Move cursor up, move cursor down, place tile here -

The script on the new doc just flips between active windows and moves the cursor.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top