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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
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/
 
Back
Top