visual basic and custom outlook form

G

Guest

Hi
i have added a button on in the standard toolbar when the user opens un mail and did it with an add in in vb6.
When i click on the button, i'd like to open a custom form (.oft) that i've designed but i don't know how i can reference that custom form
thx

RD
 
S

sw

I would create a macro and then assign that macro to the
button you created. The macro needs to reference the
custom outlook form. An example is below.

Sub Test()

Set myNameSpace = Application.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(9)
'This is the appointment folder
Set myFolder = myFolder.Folders("Test")
'This is a sub folder that you create under the Calendar
folder
Set myItem = myFolder.Items.Add("IPM.Appointment.Test")
myItem.Display

End Sub

You would then assign this macro to your custom button.
Hope this helps

sw
-----Original Message-----
Hi,
i have added a button on in the standard toolbar when the
user opens un mail and did it with an add in in vb6.
When i click on the button, i'd like to open a custom
form (.oft) that i've designed but i don't know how i can
reference that custom form ?
 
S

Sue Mosher [MVP-Outlook]

sw's post gave you the MAPIFolder.Items.Add method for creating an item
based on a published form. To create an item using a saved .oft file, you
use a different method -- Namespace.CreateItemFromTemplate.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Raymon dub said:
Hi,
i have added a button on in the standard toolbar when the user opens un
mail and did it with an add in in vb6.
When i click on the button, i'd like to open a custom form (.oft) that
i've designed but i don't know how i can reference that custom form ?
 

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