How to automatically refresh an appointment windows after changing the MessageClass property ?

Status
Not open for further replies.

Marc M.

New Member
Outlook version
Email Account
Exchange Server
Hi,

I created a custom form to display user defined fields in appointment items.
It works fine. This new form is defined as default appointment class (IPM.appointment.myForm).
When I add an appointment, the window is displayed with this form, even when somebody adds an appointment thru my shared calendar ! Great !

But... we use a special application which writes directly in Exchange Server (why not ?).
Unfortunately, when I open the appointments created by it, my custom form is not used. Of course, I can change it. But, if this application updates again the appointment, the custom form class is lost...
As I'm not sure I'll be able to get this problem fixed by the editor, I must find a solution on my side.

My question is not why this application does not respect my custom form, but how I can get around it...

If the messageClass property is not set correctly, I would like to update it, but, "just before" the window is displayed.
I have tried to update it thru a button launching a VBA macro once the window is displayed. But the window is not "refreshed" : my change is not taken into account until I reopen the window.

How can I do ?

Thanks
 
I think you could check it using the open event then change it. I don't have any code samples, that I recall. How often do the vents update? I have a macro at slipstick.com that will check all apt and change them. You could run that every now and again, triggered by a reminder.

Sent from my Surface 2 using Tapatalk
 
Hi Diane,

Thanks a lot for your answer ! I thought about open event. But, I'm a newbie with VBA. I supposed it may exist but I could not find any simple sample.
I found this :
Code:
Private WithEvents appt As Outlook.AppointmentItem

Private Sub appt_Open(Cancel As Boolean)
  MsgBox "Open Event"
End Sub

and saved it in the "ThisOutlookSession" module. But, when I open an existing appointment, no message box... :(

About the event updated, well, the other application manages our timatables (it's more powerful than Outlook). So, it may happen at anytime, several times a day if a colleague decides to update my appointment thru this tool.
Fortunately, user defined data are set and remains even if the fields are not displayed. Most of the time, they are set by this extra application. I just must ensure that there are displayed when I open such an appointment. Your macro may be useful if the timetable does not change a lot... not in my case unfortunately.

Best Regards,

Marc
 
Hi,

I made a few tests yesterday. A colleague helped me : we could not make this code to work. So, he added an event handler on application. We could then check if the object linked to the open event was a appointment.
Unfortunately, when just read the messageClass of the appointment, Outlook crashes :(

Marc
 
For gettign the Item_Open event, you need to track the SelectionChange event, and set a reference on the first selected item. It'd be easier to use the Newinspector event. You cannot cancel it, however, you could can use ot to get a reference on the item, change the MessageClass, close the item, display a prompt telling the user what's going on, and re-open it.
For your third-party app: The messageclass is often set back to the default if UserProperties are accessed.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T Outlook 2010 emails do not refresh automatically Exchange Server Administration 1
C Refresh IMAP folder list automatically OUTLOOK 2010 Using Outlook 4
M Outlook 365 macro - automatically attach file based on subject line Outlook VBA and Custom Forms 0
kburrows Outlook Automatically Merging Contacts Using Outlook 2
A Opening a link from an email automatically Outlook VBA and Custom Forms 0
A Opening a link from a specific sender automatically Outlook VBA and Custom Forms 4
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
J Calendar events created on iPhone automatically changing default alert from 'None' to 'Time of Event' Using Outlook.com accounts in Outlook 0
Z Automatically adjust Outlook Reading Pane from bottom to right depending on portrait or landscape window Using Outlook 1
G Automatically delete email when a condition is met Outlook VBA and Custom Forms 1
Hornblower409 Automatically or Manually Backup Multiple Versions of VbaProject.OTM Outlook VBA and Custom Forms 1
B Outlook 2019 Automatically move email after assigning category Using Outlook 4
G automatically choosing "add to autocorrect" option Using Outlook 0
L Why are some email automatically going to "archive" Using Outlook 2
Z Outlook 365 Automatically assign categories to incoming mail in a shared folder Round Robin Outlook VBA and Custom Forms 1
G Automatically delete messages in the synchronization folder Outlook VBA and Custom Forms 3
C Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 4
E Remove flag automatically Using Outlook 4
T Outlook 365 Move newly created tasks automatically on save. Outlook VBA and Custom Forms 1
M Outlook 365 Switching from AOL to Yahoo automatically Using Outlook 5
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
B Zoom automatically next email item (VBA) Outlook VBA and Custom Forms 2
Paul Hobbs Automatically accept "Empty Folders" prompt Outlook VBA and Custom Forms 6
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
D Custom Search Folders not refreshing/updating automatically Using Outlook 0
M Automatically add senders first name to a greeting Outlook VBA and Custom Forms 1
C Add Form to Appointments Received, Automatically Outlook VBA and Custom Forms 6
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
Y Outlook 2013 Stop Outlook from automatically assigning categories to Tasks Using Outlook 0
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
A How to open a specific link automatically with outlook 2016 Outlook VBA and Custom Forms 6
P Automatically Categorize Meetings once they are accepted Outlook VBA and Custom Forms 5
W Automatically open attachments without automatically printing them Using Outlook 0
N How to set automatically the default or user defined Quickstyle Templates by Answer in Outlook Using Outlook 1
O Run macro automatically at sending an email Using Outlook 11
D Outlook 2016 automatically increment anniversaries Using Outlook 1
T Office 2013 no longer updating automatically Using Outlook 2
B Automatically Forward Emails and Remove/Replace All or Part of Body Outlook VBA and Custom Forms 8
D Print attachments automatically and moves the mail to a new folder Outlook VBA and Custom Forms 9
A How to open a specific link automatically with outlook Outlook VBA and Custom Forms 13
L Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 33
N how to sync automatically when outlook opens Using Outlook 10
A Sort emails into subfolders based on sender and deleting emails automatically Outlook VBA and Custom Forms 3
undercover_smother Automatically Forward All Sent Mail and Delete After Send Outlook VBA and Custom Forms 10
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
stephen li VBA Outlook send mail automatically by specified outlook mail box Outlook VBA and Custom Forms 1
R Make Enter Network Password Prompt Go Away Automatically Using Outlook 0
I Print Automatically Attachments Outlook VBA and Custom Forms 3
S Automatically selecting folders and deleting messages in Outlook VBA Outlook VBA and Custom Forms 7
M Outlook 2016 Rules Not Working Automatically Using Outlook 5

Similar threads

Back
Top