none
my vbscript button1_click code works on appointment created but not on opening an existing appointment RRS feed

  • Question

  • hi I have an open_item sub and a commandbutton1_click sub.
    the open_item loads data from a db and into a listbox.possiblevalues while the selected value is stored on a custom field
    the commandbutton1_click creates a access.application object.(is it possible to do so in a modal way?)
    When I create the appointment with the custom form everything works fine but when I open an existing appointment nothing works.It's ok for the listbox not to change items because they represent a stored value but I reallly need the button1_click to work...in both new and existing appointments
    Any Ideas
    Thursday, June 23, 2016 6:06 PM

Answers

All replies

  • small detail:if I design this form and pushing execute form withjout anything else the button works
    Thursday, June 23, 2016 7:14 PM
  • Hello,

    Are you sure that a custom form with your VBScript code is used for opening existing appointments?

    Custom forms are associated with Outlook items based on the message class. Try to compare the MessageClass property values. Is there any difference?


    [custom.development]

    Thursday, June 23, 2016 7:27 PM
  • Hi savvask,

    According to your description, I suggest that you could refer to this article about How to update existing items in an Outlook folder to use a new custom form

    https://support.microsoft.com/en-sg/kb/201087

    Thanks for your understanding.
    Monday, June 27, 2016 5:13 AM
  • in the calendar.properties the nickname I gave to the form does appear as  message class. As I said in the allfields tab I in the designer the message class seems to be set to ipm.appointment. but I don't think that matters. the form *is* in the properties and all controls are shown and all fields store values. It's just that the second time I open an item (any)code works not, not a single line is read

    Monday, June 27, 2016 12:25 PM
  • Well, The form  appears both on calendar properties(IPM.Appointment.Nickname) and inside an appointment (P.2.).

    When creating an appointment the code runs,controls show,custom fields store calue...

    When opeining an exististing form controls work values are stored but the code does not run...not a single line of the item_open function or the commandbutton1_click.(these are the only pieces of vbscript code there)

    Monday, June 27, 2016 12:43 PM
  • >>>When opeining an exististing form controls work values are stored but the code does not run...not a single line of the item_open function or the commandbutton1_click.(these are the only pieces of vbscript code there)

    According to your description, custom Outlook forms are subject to several layers of security that determine whether VBScript code behind the form can run and whether ActiveX controls (beyond those included with Outlook) are blocked.
    In most cases, if VBScript code does run, it will not be subject to "object model guard" security prompts, as long as all Outlook objects are derived from the intrinsic Application and Item objects that custom form VBScript code supports. 

    By default, items created with custom forms do not run code when the user opens them from a shared mailbox. You could try to set these settings are in the Tools | Trust Center dialog, under E-mail Security.

    For more information, click here to refer about Outlook Custom Forms Security Issues

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
    Tuesday, June 28, 2016 6:35 AM
  • i enabled VBS in public and shared folders although I don't use any of them. I'll check the security link you provided. In the mean time if you think of something please contribute

    Thnx In Advance,

    SavvasK

    Tuesday, June 28, 2016 11:13 AM
  • Hi savvask,

    I suggest that you could test it on an other machine to make sure whether this issue can be reproduced.

    Thanks for your understanding.
    Wednesday, June 29, 2016 7:50 AM
  • *sigh* I found out that the problem is computer-specific...in other installations it works...Can you find what causes it then
    Thursday, June 30, 2016 11:02 AM
  • >>>I found out that the problem is computer-specific...in other installations it works...Can you find what causes it then

    I suggest that you could compare specific computer, Is Outlook same Version, and installed same update?

    Thanks for your understanding.
    Friday, July 1, 2016 4:49 AM