Launching an UserForm from a cutomised form

T

Tof

Hello everybody,

I apologize for my english, but it's not my mother's tongue.

I've created an UserForm in VBA (Outlook 2003). It's an userfom like the
one that is lauching when you click on the "Categories" button, but with
my personnal list of item (just a little window, with a liste of item to
choose).

I want to know if it is possible to launch this Userform from a customised
form : I would like to add a button to my form that will launch this UserForm.
Is it possible, and if yes, how ?

Thank in advance, and sorry again for my english.
Sincerly,
To
 
S

Sue Mosher [MVP-Outlook]

Yes, it's possible, but not a supported operation. Write a Public procedure in your ThisOutlookSession module to launch the userform. You can then call that procedure from your custom form's script with Application.My_Procedure_Name.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
T

Tof

Hello Sue Mosher [MVP-Outlook],

Thank you very much for your so quick answer ! (8 minutes : faster than santaClaus
;) ! )

Could you give me a little bit more precision lease. I'm beginning in Outlook
programing...and it's a little hard for me.

Perhaps could you gvie me just some links to find some documentation about
that procedure (I guess that you are very busy and don't have always time
to explain all to every beginners that is coming here :) )

Sincerly,
To
 
S

Sue Mosher [MVP-Outlook]

If your user form is named MyForm, this code goes in ThisOutlookSession in VBA:

Public Sub ShowMyForm()
MyForm.Show
End Sub

And this code would be the event handler for a command button on your custom form named CommandButton1:

Sub CommandButton1_Click()
Application.ShowMyForm
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
T

Tof

Hello Sue Mosher [MVP-Outlook],

Thank you very much for your answer.
It's very precious for me !

And thank you also for your book , that I've finally find in France (and
in french ! :) )
It's very helpful (even if the only one that I've found was (I'm not sure
of the english title) "Learn Outlook 2000 Programming in 24 hours")
If think I'll spend 24 month instead ;) ! But it's enough for me, and for
beginning.

Good Evening
Sincerly
To
 
S

Sue Mosher [MVP-Outlook]

That's a very old book, and many things have changed since then, so please feel free to ask (even en francais) if you have any questions.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top