how do i a button to a new message form?

E

Elhanan

hi..

i would like to have a new button assinged a new message form, the
button will do some stuff in vb, i looked in the add-in
documentation,and saw how to add buttons to menu bars, but i don't know
how to add them to outlook forms.
 
S

Sue Mosher [MVP-Outlook]

You add controls to forms in by putting the form into design mode. The code is not VB, but VBSCript. See http://www.outlookcode.com/d/forms.htm

What is the purpose of this form? A menu bar button might be more appropriate.

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

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

Elhanan

the question is, can this form somehow replace the usuall new message
form.

also how can draw a button and attache a vbscript code to it.
 
S

Sue Mosher [MVP-Outlook]

Wrong question. You should be asking whether it's appropriate to use a custom message form. The only way we can help you answer that is if you provide the information about the form's purpose/usage that I requested earlier.

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

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

Elhanan

a programmer showed an example of what he wanted:

create a new sub in vba editor

go to tool->Customize, commands tab, choose Macros and select the sub
you created, drag it to menu bar in a new message form. this new button
AND it's code should appear on every new message window in the
orgnization, how do i deploy this?
 
E

Elhanan

i allready looked at com add-in, but from code i saw, i only understood
how to add it's buttons to outlook menus, not to the menus of a new
message form.
 
S

Sue Mosher [MVP-Outlook]

The technique is the same, but uses the Inspector instead of Explorer window. Often a wrapper class is used to handle the possibility of multiple windows being open. See http://www.outlookcode.com/d/vb.htm#wrapper for examples.

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

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

Elhanan

so what you are saying if i understand correctly, is to do the
follwing:

create an outlook com add-in, get it's inspector collections, and
registed it's new inspector events.

then when a new inspector arrives checks if it's currentitme is of type
mailitem (so i won't care about other stuff like contacts).

then create a new class that will recive a refrence to the new
inspector, this class will then be responsible for the new item, and
add it's own buttons to the new mail commandbards, since each new class
will have it's own commandbars objects, it will respond only to their
own events right?
 
S

Sue Mosher [MVP-Outlook]

Bingo! Better than I could explain it.

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

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

Elhanan

hi.. when trying the following, on opening certian mails

oInspector.CommandBars.Add("Image", msoBarTop, , True)

sometimes i get:
method Add of object _Commandbars failed

i don't know if this is becouse the customize of the command bars is
disabled in these mails, or becouse they wordeditor
 

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