Help with creating event for clicking follow up buttons (vba)

G

Guest

Hello,

I am trying to create an event that fires when a user changes the flag
status of a mail item in the inbox. For example: If a message had a red
flag and I clicked on it. It would then become a check mark. It is at this
point that I'd like to run some code to push the contents of the message to
access via ADO. That part I can tackle, but I haven't the slightest idea on
setting up an event that will fire when I change the flag status. Please let
me know if I didn't provide enough information. Thank you
 
G

Guest

This will be easy if the items are based on a custom form - use the
PropertyChange event in the VBScript code behind the form to trap the change.

Otherwise, the solution is a little involved. You will need to trap the
Explorer.SelectionChange event and grab the Explorer.Selection
object/collection to get a reference to the selected item. Then you would
need to add each MailItem object to a "monitored" collection variable in your
solution to wire up the PropertyChange event for each one. This technique is
basically what is described here:
http://www.slovaktech.com/code_samples.htm#InspectorWrapper. Only insead of
an Inspector wrapper, you would be creating an Item wrapper.

Let me know if you have any more questions.
 
G

Guest

Which custom form should I use? There are various forms to choose
from...would I develop my own form? Unfortunately for me I haven't used
custom forms in outlook :( Can you shed a little light? Thanks in advance
 
G

Guest

How would I access the properties of the current mail item in the
PropertyChange event?
 
G

Guest

The Name argument that is passed to that event gives you the value you need
to call the property or set an object to that property:

Dim objIP 'Set to an ItemProperty object

Set objIP = Item.ItemProperties(Name)
MsgBox "Value of " & Name & " property: " & objIP.Value

All the documentation for the Outlook Object Model is here if you need an
invaluable reference:

Download details: Office 2003 Editions: Outlook VBA Language Reference:
http://www.microsoft.com/downloads/...80-23e2-456f-8618-4da50cc2c38c&DisplayLang=en

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 

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