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 / March 2005

Tip: Looking for answers? Try searching our database.

Creating a macro to open a dialog box.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vince - 11 Mar 2005 06:05 GMT
Using MS Word 2003

I would like to create a macro that opens a dialog box that prompts the user
to accept or deny certain terms.

The best example I can use is a EULA. Either you agree to the terms and the
document opens, or you disagree and document does not open.

Trying to figure this out alone is quite difficult, and any assistance
offered will be greatly appreciated.

Can anyone help me with this issue?
Jezebel - 11 Mar 2005 06:23 GMT
They are called UserForms in VBA. Add the form, put on it whatever controls
you need, write the code ...

> Using MS Word 2003
>
[quoted text clipped - 10 lines]
>
> Can anyone help me with this issue?
Vince - 11 Mar 2005 07:37 GMT
Thanks for the input Jezebel!

Maybe I should be a bit more clear. I do not know VBA code; however, I do
know other languages and understand certain things.

I have created the project, added the userform to the correct document,
created the content, and started the buttons. I'm trying to figure out the
button contorls at the moment, and I was hoping that I wouldn't have to
manually type any code.

Maybe that's too much to desire... :)

> They are called UserForms in VBA. Add the form, put on it whatever controls
> you need, write the code ...
[quoted text clipped - 13 lines]
> >
> > Can anyone help me with this issue?
Jezebel - 11 Mar 2005 07:53 GMT
If you're working with VBA, yes, that's too much to hope for.... :(

> Thanks for the input Jezebel!
>
[quoted text clipped - 26 lines]
>> >
>> > Can anyone help me with this issue?
Jonathan West - 11 Mar 2005 12:32 GMT
> Thanks for the input Jezebel!
>
[quoted text clipped - 7 lines]
>
> Maybe that's too much to desire... :)

You will need to write some code.

If you're already familiar with other languages, these two articles ought to
get you up & running in VBA

Getting To Grips With VBA Basics In 15 Minutes
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm

How to create a Userform
http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

Vince - 16 Mar 2005 00:05 GMT
Thank You very much Jonathan! The URLs were a great help!

With your help, I've learned to close the document via the Deny button, and
hide the form via the Accept button.

At this point, I've developed a template; however, I need to learn how to
run the macro during opening. This leads to another issue. When I open the
template and run the macro, the userform is not displayed. Running the macro
from the VB Editor does display the form, but only if the form window is
active. Seems strange to me, but I am still working on it.

Once again, Thanks for the assistance.

> > Thanks for the input Jezebel!
> >
[quoted text clipped - 18 lines]
> How to create a Userform
> http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
Jonathan West - 16 Mar 2005 00:37 GMT
> Thank You very much Jonathan! The URLs were a great help!
>
[quoted text clipped - 10 lines]
>
> Once again, Thanks for the assistance.

Hi Vince

You can run the form from a macro by doing something like this

Sub RunMyForm()
 frmMyForm.Show
End Sub

If you want  the form to show when you create a new document based on the
template, call the macro AutoNew instead of RunMyForm. If you want the form
to show every timke you open a document based on the template, call the
macro AutoOpen.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

 
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.