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.

dialogue response

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
erin.sebastian@cowaninsurancegroup.com - 15 Nov 2005 19:45 GMT
Hello everyone,
I have a word document that has a macro attached to it, inside the
macro i open a form and want to send the response (0 or 1) back to my
main module but i don't know how to do this. In vb.net you can say
openDialogue and then set the dialogueResponse which will hand the
response back to your main form.. i don't know how to do it in VBA...
can someone please help?
Thanks,
Erin
Doug Robbins - Word MVP - 15 Nov 2005 20:29 GMT
See the MsgBox function.

MsgBox Function Example
This example uses the MsgBox function to display a critical-error message in
a dialog box with Yes and No buttons. The No button is specified as the
default response. The value returned by the MsgBox function depends on the
button chosen by the user. This example assumes that DEMO.HLP is a Help file
that contains a topic with a Help context number equal to 1000.

Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue ?"    ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2    ' Define buttons.
Title = "MsgBox Demonstration"    ' Define title.
Help = "DEMO.HLP"    ' Define Help file.
Ctxt = 1000    ' Define topic
       ' context.
       ' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then    ' User chose Yes.
   MyString = "Yes"    ' Perform some action.
Else    ' User chose No.
   MyString = "No"    ' Perform some action.
End If

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 everyone,
> I have a word document that has a macro attached to it, inside the
[quoted text clipped - 5 lines]
> Thanks,
> Erin
erin.sebastian@cowaninsurancegroup.com - 15 Nov 2005 20:39 GMT
So do this instead of using the forms???
erin.sebastian@cowaninsurancegroup.com - 15 Nov 2005 20:53 GMT
I  have implemented this code, thanks so much !!!!!!

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.