Link to home
Start Free TrialLog in
Avatar of BLACK THANOS
BLACK THANOSFlag for United States of America

asked on

How do I fix the Item_Open function in Microsoft Code behind the forms.

Good Morning Experts,
I  have just discovered that I can no longer use Outlook's code behind the form that uses vb-script as the underlying programming environment. I have been building custom forms for various people,small offices, and Healthcare companies since code behind the form with vb-script began in 1997. I have been out of the loop for a few years because  of various disabilities. The last time I created forms for an entity was in Outlook 2013. Fast forward six years and I've discovered that even-though the choose/design developer form is still available,it  wont fire off the Item_Open function which is where my vb-script code goes. However I suspect that even if I put code outside of the Item_Open function it still wouldn't work. To prove this, I tried the following code snippet: (I have submitted screen shots of the process)

User generated image
User generated image
User generated image
User generated image
User generated image
The Result should have been a simple message that said "helloinside"

You will notice that I kept it simple. I took out the actual code that was supposed to run to test my theory about the Item_Open function simply not firing. Here are some helpful (hopefully) articles that I have researched on the internet ,that speak to the Item_Open Function:


Outlook custom form: Item_Open event not getting fired

KB3203467 KB3191938 KB3191932 stopping the VB script in Outlook Custom Form in 2010/2013/2016/O365

The links speak to the problem being fixed as early as 2017, but I still have the same problem, the Item_Open function will not trigger with even the simplelest of code snippet: "helloinside"

It should be noted that Outlook 2013 still works as advertised. All other versions of Outlook (2016,2019) have the issue of not triggering the function. I have not tried code behind the form with Office365's Outlook application. I would hate to tell my client that they have to go to Office365 to take advantage of code behind the form.

Experts,
I hope that I have been as thorough as can be explained with my problem.This is a high priority for me, so thank you in advance for your anticipated responses.

Regards,
Regis T. Hyde (BlackThanos)
Avatar of PatHartman
PatHartman
Flag of United States of America image

This is not my area of expertise since I work with Access forms.  
Did you try removing the security patch?
Are you sure that other updates have been applied?
What version are you working with?  Get this from the About screen so we have the complete version number.
one suggested solution is to return to 2013

a bug like this may take some time for MS to take any action
Avatar of BLACK THANOS

ASKER

PatHartman wrote:

"This is not my area of expertise since I work with Access forms.  
Did you try removing the security patch?
Are you sure that other updates have been applied?
What version are you working with?  Get this from the About screen so we have the complete version number."


Good evening PatHartman,

I am not familiar with the security patch to which you speak of. Please clarify, so that I can Remove it.
For clarity , Outlook's Product Information windows says it is up to date:

User generated image
Paul Sauvé wrote:

"one suggested solution is to return to 2013
a bug like this may take some time for MS to take any action"


Good evening Paul,

Thanks for the suggestion,
but reverting back to 2013 would be impossible at this point , as all my clients are on  Outlook 2016 - Office 365 Outlook.
Your second link pointed to the security patch that caused this problem.  uninstalling that patch, if possible, is a start.
Good evening Pat,
Yes, I added the link , but I don't know how to uninstall the patches: KB3203467 KB3191938 KB3191932 .
I went of windows updates and the aforementioned patches are not installed or I am just not looking into the right place. Thoughts?
I wrote:

"I went of windows updates "

I meant:

"I went to windows updates"
We've gotten beyond my paygrade.
Thanks for you support Pat.
I'll try on pc later, haven't used script in that event but extensively in other office apps.  That link followed through leads to apparent fixes?
https://support.office.com/en-us/article/Outlook-known-issues-in-the-June-2017-security-updates-3f6dbffd-8505-492d-b19f-b3b89369ed9b
Good evening Steve,
Yes I came across that link also, but it does not give a solution other than stating that the issue is fixed.

Issue #4: VBScript does not run or you receive malicious code warning when using a custom form for Outlook [Fixed]

The article also states:

Issue is fixed for all MSI versions. For Outlook 2007, Outlook 2010, Outlook 2013 and Outlook 2016, install the updates below to fix the issue:

Update for Outlook 2007: July 27, 2017

Update for Outlook 2010: July 27, 2017

Update for Outlook 2013: July 27, 2017

Update for Outlook 2016: July 27, 2017




Am I supposed to uninstall the update for Outlook 2016? If so , I went to the link:


What am I to do with this link
Good afternoon experts,
I found a partial solution to  my issue. I had to make some registry changes on my computer. Here is the link in question:

Registry Changes

I can now use the code behind the form with vbscript. Allow me to show you some screen shots:

1.   I go back to the Developer tab and choose design a form

User generated image
2. Choose the drop down button to get to the Personal Form Library and then open the TestDataBase form/

User generated image
3. You can now see the design view for a simple drop down menu.

User generated image
4. When I run the form a simple form with a drop down list  can be viewed with four items in it

User generated image
So, with all that said, I can now use the code behind the form with vbscript.
However , even after publishing the form, and running it from the choose form option, I get this:

User generated image
As you can see the form doesn't show the drop-down menu, meaning, the vb-script does not run outside of the design view.

Please refer to the link I provided and you will see the changes I made to the registry that in summary looks like this:

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\16.0\Outlook\Security]

DisableCustomFormItemScript"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\16.0\Outlook\Forms\TrustedFormScriptList]

"IPM.Note.Custom"=""

"IPM.Note"=""

Experts,
I hope my explanation was understandable as I need to find a complete solution for my problem.
Hello,

I have had a little try with this earlier and had a number of hurdles relating to the system I was connecting with  in Outlook so couldn't really try it out properly to trigger the event.  I was toying with the idea of a more general checking for itemload event if that was more feasible.

I will keep an eye on this question and try out more if I can.

Steve
Thank You Steve
Good evening Moderator,
How can I close this question as unresolved and move on.
ASKER CERTIFIED SOLUTION
Avatar of BLACK THANOS
BLACK THANOS
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial