none
don't run script when copy of form is opened RRS feed

  • Question

  • I've got a VS Add-in for Outlook that moves a Task item to the user's Drafts folder. This creates an email and copies the information from the Task into the body of the email, which is the behavior I'm after. Also, a copy of the custom Task form for the item appears at the bottom of the email, which is good.

    But there is custom code in the form, that is trusted in the original item. When the item is opened or closed, a custom field on the form is updated with the user's name, date & time. This is working fine on the items saved in Exchange.

    But in the copy of the item that gets added to the new email, if the recipient of the email opens the attachment they get an error message:
    Script Error
    You don't have appropriate permission to perform this operation.
    Line No: 367
    Same when the user closes the item.

    Is there a way to remove the code from the form before it is copied to the Drafts folder?
    Or is there a way to disable the code on the form when it's attached to this email without disabling it in general?

    Thanks.

    Sunday, November 1, 2015 1:46 PM

Answers

  • Hello Gordon,

    Do you use an Outlook form regions or Outlook custom forms?

    If you are talking about scripts behind the form, it is a custom form. There is no way to disabled the code until you change the message class of the item. Custom forms are associated with Outlook items using the MessageClass property value.

    Sunday, November 1, 2015 5:12 PM

All replies

  • Hello Gordon,

    Do you use an Outlook form regions or Outlook custom forms?

    If you are talking about scripts behind the form, it is a custom form. There is no way to disabled the code until you change the message class of the item. Custom forms are associated with Outlook items using the MessageClass property value.

    Sunday, November 1, 2015 5:12 PM
  • They're custom forms from Outlook 2003. They're running now in 2007 and 2010 copies.

    Thanks for the idea on MessageClass.

    Sunday, November 1, 2015 7:29 PM