forward event of Custom form

G

Guest

I developed a custom form in VSTO. And when forwarding the custom form, the
showing form is also the custom form. But I want to use the default message
form when forwarding.
The coding like following:
Dim oMsg As Outlook.MailItem
oMsg = Me.CreateItemFromTemplate(strPath + "test.oft")

oMsg.MessageClass and oMsg.Forward().MessageClass are the same which is
"IPM.Note".

oMsg.FormDescription.MessageClass and
oMsg.Forward().FormDescription.MessageClass are the same which is
"IPM.Note.CustomForm".

Further more, I have set the action property "forward" to the default
message form in test.oft mail template design. But its
formdescription.messageclass is the customform class.

How could I modify the forward() to use the default messageclass, and its
formdescription also use the default messageclass.

Thanks
 
S

Sue Mosher [MVP-Outlook]

A forwarded message always uses the custom form associated with original message. The only workaround I know is to use the Forward event to create a new item using Application.CreateItem and then populate its properties and send it.

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

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

Guest

Thanks for your quickly reply:)

But could you tell me how to get the forward event? Or some examples.

Thank you very much
 
S

Sue Mosher [MVP-Outlook]

Use the Script | Event Handler command in the form's code window to insert the procedure signature:

Function Item_Forward(ByVal ForwardItem)

End Function

ForwardItem is the new item that the Forward command creates.

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

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

Guest

I have tried to insert the script in form's code.

But there is a problem with preview panel. If I put some script in form's
code, there will be an alert like "This item contains active content that
cannot be displayed in the reading pane. Open the item to read its contents."

So I think I should add code in VSTO. But could you tell me how to get the
mailitem forward event in VSTO.

Thanks
 
S

Sue Mosher [MVP-Outlook]

That's normal behavior for forms with script behind them.

To handle item-level events with VSTO, you should use a wrapper class. See http://www.outlookcode.com/d/vb.htm#wrapper.htm

--
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