Is it possible to create and publish Outlook Custom Form through VBA

U

ujwalabamishte

Hi All,
I have created COM-Addin for Outlook in VB. But there are lot of
limitations in VBScript like to handle all events(other than click
event) of controls(ListView,Textbox) on outlook custom form. Can we
handle these events using VBA so that i can distribute that
application? Or Is it possible to create and publish that form through
VB.?

Thanks,
 
K

Ken Slovak - [MVP - Outlook]

You can certainly create your own VB forms that will give you a full set of
events but you cannot extend the events that you receive in a form's
controls from an addin. You would still only get Click and that would be
fired in the VBScript code.
 
S

Sue Mosher [MVP-Outlook]

Actually, I think all the control events may be available. I posted this little VBA snippet at http://www.outlookcode.com/threads.aspx?forumid=3&messageid=16824 and I get both Change and Click events firing from a custom form item checkbox, regardless of whether it's bound or unbound. I think that's also the technique that BCM add-in uses.

Dim WithEvents chk1 As MSForms.CheckBox

Sub initChk1()
Set chk1 = Application.ActiveInspector.CurrentItem. _
GetInspector.ModifiedFormPages("General").Controls("CheckBox1")
End Sub

Private Sub chk1_Change()
MsgBox "Change"
End Sub

Private Sub chk1_Click()
MsgBox "Click"
End Sub

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

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



Ken Slovak - said:
You can certainly create your own VB forms that will give you a full set of
events but you cannot extend the events that you receive in a form's
controls from an addin. You would still only get Click and that would be
fired in the VBScript code.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Hi All,
I have created COM-Addin for Outlook in VB. But there are lot of
limitations in VBScript like to handle all events(other than click
event) of controls(ListView,Textbox) on outlook custom form. Can we
handle these events using VBA so that i can distribute that
application? Or Is it possible to create and publish that form through
VB.?

Thanks,
 
K

Ken Slovak - [MVP - Outlook]

Ah, OK, you're essentially subclassing the controls that way. That should
work, good thinking Sue. The only caveat is that some of the MSForms
controls don't like being used in VB so they might not like VBA either.




Actually, I think all the control events may be available. I posted this
little VBA snippet at
http://www.outlookcode.com/threads.aspx?forumid=3&messageid=16824 and I get
both Change and Click events firing from a custom form item checkbox,
regardless of whether it's bound or unbound. I think that's also the
technique that BCM add-in uses.

Dim WithEvents chk1 As MSForms.CheckBox

Sub initChk1()
Set chk1 = Application.ActiveInspector.CurrentItem. _
GetInspector.ModifiedFormPages("General").Controls("CheckBox1")
End Sub

Private Sub chk1_Change()
MsgBox "Change"
End Sub

Private Sub chk1_Click()
MsgBox "Click"
End Sub

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