none
Custom Outlook Appointment not running VBA code RRS feed

  • Question

  • Hi,

    I have a custom form that is an appointment.  If I run the form there are various buttons on it that open up URLs and it all works swimmingly.

    However, If I then save the appointment to my calendar and open it from there, none of the VBA code in the form runs so the buttons no longer work.

    Is there some kind of quirk that prevents code from running in appointments/meeting requests once they are in a calendar or am I missing some setting or something?

    Just to be clear, it isn't just the code behind the buttons that isn't running, it doesn't fire the Item_PropertyChange event code even.

    Any help much appreciated - I have trawled the web for a long time on this to no avail :-(

    Many thanks,

    Chris


    Life's easy when you have the answers... so let me have 'em!!!

    Wednesday, December 5, 2012 11:40 AM

Answers

  • Don't check to include the form definition, it one-off's the form and should only be used in special circumstances such as sending a custom mail form to recipients where the form isn't published and it's sent using RTF.
     
    You always need to set a version and if you change the form and re-publish you need to change the version so the latest is used and you don't cause forms cache corruption. You also should never publish a form in more than one location. Either use Personal Forms, Organizational Forms or a folder, not more than one.
     
    For a form without a custom MessageClass (IPM.Appointment.MyForm) you need to change the default form for the item type in the registry for every computer where the form will be used. Otherwise you create all sorts of other problems.
     
    I think you should spend some time reviewing the forms information at www.outlookcode.com, that has information that will allow you to avoid the most commons pitfalls with Outlook form design.
     
    Also, custom Outlook forms are "not the most robust" and if you are designing for Outlook 2007 and later I'd recommend using Form Regions instead of custom Outlook forms.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Humanscar" <=?utf-8?B?SHVtYW5zY2Fy?=> wrote in message news:3b331d98-9a43-4004-af65-7b8919a5552b...

    Hi Ken,

    Right...

    Outlook 2010;

    yes it is Outlook VBA;

    yes it is published;

    and it is an IPM.Appointment message class, though the "send form definition with item" is not checked (never really got my head around when to check that checkbox - perhaps you could elaborate for me if you do!)

    [EDIT] I think I have figured it out - the form didn't have a version number set, which appears to have solved the problem when published in my Personal Forms Library, but not yet tested in the Organisational Forms Library.

    Many thanks,

    Chris


    Life's easy when you have the answers... so let me have 'em!!!



    Ken Slovak MVP - Outlook
    • Marked as answer by Humanscar Monday, December 10, 2012 10:43 AM
    Thursday, December 6, 2012 2:52 PM
    Moderator

All replies

  • What version of Outlook?
     
    Is this Outlook VBA code?
     
    Is the form published?
     
    What MessageClass is the form saved as in your calendar, is it with the form's custom MessageClass?

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Humanscar" <=?utf-8?B?SHVtYW5zY2Fy?=> wrote in message news:23eb6122-86a8-456e-b36f-aaebb35c9691...

    Hi,

    I have a custom form that is an appointment.  If I run the form there are various buttons on it that open up URLs and it all works swimmingly.

    However, If I then save the appointment to my calendar and open it from there, none of the VBA code in the form runs so the buttons no longer work.

    Is there some kind of quirk that prevents code from running in appointments/meeting requests once they are in a calendar or am I missing some setting or something?

    Just to be clear, it isn't just the code behind the buttons that isn't running, it doesn't fire the Item_PropertyChange event code even.

    Any help much appreciated - I have trawled the web for a long time on this to no avail :-(

    Many thanks,

    Chris


    Life's easy when you have the answers... so let me have 'em!!!


    Ken Slovak MVP - Outlook
    Wednesday, December 5, 2012 2:24 PM
    Moderator
  • Hi Ken,

    Right...

    Outlook 2010;

    yes it is Outlook VBA;

    yes it is published;

    and it is an IPM.Appointment message class, though the "send form definition with item" is not checked (never really got my head around when to check that checkbox - perhaps you could elaborate for me if you do!)

    [EDIT] I think I have figured it out - the form didn't have a version number set, which appears to have solved the problem when published in my Personal Forms Library, but not yet tested in the Organisational Forms Library.

    Many thanks,

    Chris


    Life's easy when you have the answers... so let me have 'em!!!


    • Edited by Humanscar Thursday, December 6, 2012 8:55 AM possibly answered
    Thursday, December 6, 2012 8:43 AM
  • Don't check to include the form definition, it one-off's the form and should only be used in special circumstances such as sending a custom mail form to recipients where the form isn't published and it's sent using RTF.
     
    You always need to set a version and if you change the form and re-publish you need to change the version so the latest is used and you don't cause forms cache corruption. You also should never publish a form in more than one location. Either use Personal Forms, Organizational Forms or a folder, not more than one.
     
    For a form without a custom MessageClass (IPM.Appointment.MyForm) you need to change the default form for the item type in the registry for every computer where the form will be used. Otherwise you create all sorts of other problems.
     
    I think you should spend some time reviewing the forms information at www.outlookcode.com, that has information that will allow you to avoid the most commons pitfalls with Outlook form design.
     
    Also, custom Outlook forms are "not the most robust" and if you are designing for Outlook 2007 and later I'd recommend using Form Regions instead of custom Outlook forms.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Humanscar" <=?utf-8?B?SHVtYW5zY2Fy?=> wrote in message news:3b331d98-9a43-4004-af65-7b8919a5552b...

    Hi Ken,

    Right...

    Outlook 2010;

    yes it is Outlook VBA;

    yes it is published;

    and it is an IPM.Appointment message class, though the "send form definition with item" is not checked (never really got my head around when to check that checkbox - perhaps you could elaborate for me if you do!)

    [EDIT] I think I have figured it out - the form didn't have a version number set, which appears to have solved the problem when published in my Personal Forms Library, but not yet tested in the Organisational Forms Library.

    Many thanks,

    Chris


    Life's easy when you have the answers... so let me have 'em!!!



    Ken Slovak MVP - Outlook
    • Marked as answer by Humanscar Monday, December 10, 2012 10:43 AM
    Thursday, December 6, 2012 2:52 PM
    Moderator