Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

msg box programming

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter - 21 Nov 2005 18:31 GMT
Hello,

I would like to code a command button that when pressed would display a
message box or another small window that will display some text. I have
programmed this successfully. What I need now, is the ability for a user to
copy and paste the text displayed in the msgbox to another part of the word
document.

Is this possible to do with a msgbox or any other control?

Thanks,
Peter
Ed - 21 Nov 2005 18:48 GMT
You'd probably have to use a UserForm which is shown vbModeless.  That would
allow the user to scroll through the doc and place the insertion point where
the text should go.  Then program the CommandButton to paste when clicked.

Ed

> Hello,
>
[quoted text clipped - 8 lines]
> Thanks,
> Peter
Doug Robbins - Word MVP - 21 Nov 2005 18:49 GMT
See the article "Manipulating the clipboard using VBA" at:

http://www.word.mvps.org/FAQs/MacrosVBA/ManipulateClipboard.htm

It contains a routine for getting the text from a string variable into the
clipboard (so that it can be pasted somewhere)

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello,
>
[quoted text clipped - 10 lines]
> Thanks,
> Peter
Peter - 21 Nov 2005 19:15 GMT
Thanks Doug,

How would you append to the clipboard or string variable? What I am doing is
displaying text in a yes/no msg box. If a user clicks "yes", it will send the
text to the clipboard. I will have about 7 msgboxes pop us one after another.
Can I somehow append the text from every msgbox that is answered "yes" by the
user into one string variable that will then be sent to the clipboard?

Or is there an easier way of doing this through another control?

Thanks,
Peter

> See the article "Manipulating the clipboard using VBA" at:
>
[quoted text clipped - 17 lines]
> > Thanks,
> > Peter
Doug Robbins - Word MVP - 21 Nov 2005 21:51 GMT
I would suggest that you have the strings displayed in a listbox on a
userform and then build a string from the ones that are selected.

See the article "How to create a Userform" at:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

and "How to find out which Items are selected in a Multi-Select ListBox" at:

http://www.word.mvps.org/FAQs/Userforms/GetMultiSelectValues.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Thanks Doug,
>
[quoted text clipped - 36 lines]
>> > Thanks,
>> > Peter

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.