Openeing a Form from Add-in

  • Thread starter Muhammad Aftab Alam
  • Start date
M

Muhammad Aftab Alam

Hello All
I want to Design a New Form in Outlook
- then Write an Add-in - Add a button to Add-in and On Click
to that Button - Call that Form
[And HAndle the events to a Push Button on
that Form
I want to perform this using C++.
I would like to know the path to achieve it and some information path on web
for it.

best regards
Muhammad Aftab Alam
 
S

Sue Mosher [MVP-Outlook]

To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection. If it's a message form, you can use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. Otherwise, you can use code similat to that at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.
 
N

Nauman Khan

Hi Sue and All,

Thanks for your Response. You have mentioned solution for Creating a New
Custom Form Item and Associating it with some Folder. What is the solution
for Launching a Custom Form, which has already been designed in Outlook and
publiched. After Launching it, how can we handle its events like Button
Click etc. Please try to Give Example for C++, as i don't understand how VB
code will be mapped to C++ code in a Com Add-in.

Regards
Nauman
Sue Mosher said:
To create a new instance of a custom form programmatically, use the Add
method on the target folder's Items collection. If it's a message form, you
can use the Drafts folder as the target. If the target is a default folder,
you can use the Namespace.GetDefaultFolder method to return it as a
MAPIFolder object. Otherwise, you can use code similat to that at
http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy
and return the MAPIFolder corresponding to a given path string.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers




Muhammad Aftab Alam said:
Hello All
I want to Design a New Form in Outlook
- then Write an Add-in - Add a button to Add-in and On Click
to that Button - Call that Form
[And HAndle the events to a Push Button on
that Form
I want to perform this using C++.
I would like to know the path to achieve it and some information path on web
for it.

best regards
Muhammad Aftab Alam
 
S

Sue Mosher [MVP-Outlook]

I already provided information on how to launch a published custom form in my earlier post: You use the MAPIFolder.Items.ItemAdd method.

Click events for command buttons on the form would need to be handled in VBScript code in the form itself.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers




Nauman Khan said:
Hi Sue and All,

Thanks for your Response. You have mentioned solution for Creating a New
Custom Form Item and Associating it with some Folder. What is the solution
for Launching a Custom Form, which has already been designed in Outlook and
publiched. After Launching it, how can we handle its events like Button
Click etc. Please try to Give Example for C++, as i don't understand how VB
code will be mapped to C++ code in a Com Add-in.

Regards
Nauman
Sue Mosher said:
To create a new instance of a custom form programmatically, use the Add
method on the target folder's Items collection. If it's a message form, you
can use the Drafts folder as the target. If the target is a default folder,
you can use the Namespace.GetDefaultFolder method to return it as a
MAPIFolder object. Otherwise, you can use code similat to that at
http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy
and return the MAPIFolder corresponding to a given path string.
Muhammad Aftab Alam said:
Hello All
I want to Design a New Form in Outlook
- then Write an Add-in - Add a button to Add-in and On Click
to that Button - Call that Form
[And HAndle the events to a Push Button on
that Form
I want to perform this using C++.
I would like to know the path to achieve it and some information path on web
for it.
 

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