How to enable ThisOutlookSession in Outlook 2007? - vba

If I put there any code, it is just not executed (looks like some security settings?). Tried to disable macro verification in the Trust Center - it doesn't help.
Code I've tried to use: 1, 2.

After changing your security settings, restart Outlook.
http://office.microsoft.com/en-us/help/enable-or-disable-macros-in-office-documents-HA010031071.aspx#BM13
You'll also want to self-sign your VBA project using the self-cert tool included with Office. After doing so, restart Outlook and you should see a dialog asking you to "trust" the project.

Yeah - you need to restart after changing the security settings.
In outlook 2013 : File_Options_trust center

Related

How to prevent a VSTO Office Add-In from automatically getting disabled?

We run some custom add-ins in Outlook application and occasionally find that the Outlook application disables them; I then have to manually go to the application settings and re-enable them on each users PC. We are running Microsoft Office 365 click to run applications. I have tried the following but nothing seem to work 100% of the time.
I have tried setting the "AddinList/ProgID" REG key to 1 (always enabled) as described here - https://learn.microsoft.com/en-us/office/vba/outlook/concepts/getting-started/support-for-keeping-add-ins-enabled.
I have also tried setting a number of registry key combinations as described here - https://www.konnectemail.com/prevent-outlook-add-in-from-getting-disabled
Is there a specific way to tell the office application to NEVER disable a particular add-in regardless of the Office version?

Outlook macros are disabled since Windows freezed previously

We use VBA macros in our company on every computer where Outlook is installed. Macros are digitally signed with a certificate to ensure security. This certificate is generate through the selfcert.exe application. When we add the digital signature on the VBA project (which contains the macros) in Outlook we choose the certificate generated previously and we check that Outlook options in the 'Trust Center Settings' are defined on 'Disable all macros except digitally signed macros'. Next, the first time we launch Outlook and run a macro, we got a message to confirm with 3 buttons: 'Trust all documents from this publisher', 'Enable Macros', 'Disable Macros'. We always choose to trust all to avoid getting this message again next time. This is working pretty well since several years on every machine.
Some weeks ago, someone complains about random freeze of Windows 10. The IT support solved this issue but unfortunately a new problem appeared: Outlook macros are always disabled on this machine. I am pretty sure this new problem is due to the previous freeze of Windows. I also read someone somewhere which crashed the disk and then Outlook macros got disabled.
What I already tried:
Remove/Add the certificate again
Create a new certificate to sign my macros
Renaming the VBA module containing the macros
Deleting the VBA module and creating it again
None of these actions worked. Macros are still disabled.
The temporary solution for now is to change the Trust Center Settings options by enabling all macros. But I cannot accept this workaround which is potentially dangerous.
I already search hours on Google and tried suggestions without luck.
Looks like your machine is corrupted. Try to repair Outlook or Office.
Be aware, you need to install a self-signed certificate as a trusted root CA in Windows. See Installing a Self-Signed Certificate as a Trusted Root CA in Windows Vista for more information.
Also you may find the Odd behaviour with macros being disabled forum thread helpful. It states the following:
I could reproduce the issue in Outlook 2013 (C2R 15.0.4927.1002). The macro would be disabled if I set 'Notifications for digitally signed macros, all other macros disabled' and i have added the CA into Trusted Publisher and Trusted Root CA list. The issue doesn't exist in Outlook 2016, I would suggest you use Outlook 2016 if you don't want to enable all macros. Besides, I suggest you submit your feedback on Outlook User Voice: https://outlook.uservoice.com/

Outlook macros are not enabled unless I enable all macros, which, it tells me, is potentially dangerous

I created a macro to work in Outlook (2016). Eventually got it working, but once I restarted Outlook, it didn't work any more.
Unless I select the option to 'enable all macros (not recommended)' - it says that the macros in the project are disabled. It doesn't come up with any option to enable them when I start the application.
I have changed security, signed it with SelfCert, closed Outlook - killed the process and restarted it. I have had the code on ThisOutlookSession, and on a separate module.
Frustratingly... it will only run if I enable all macros, which, it tells me, is potentially dangerous.
What can I do?
Running Office 2016 on Windows 10
When you're cresting own signature or with self-created signature, then save it only by setup with signature and later by closing - exit Outlook don't confirm to save it (it's configuration already saved on signature level).
I had the same situation. I've created a macro which was working fine at beginning and after restart of the Outlook I got the same error message.
Please be aware that with this solution you might put your system on risk. I only opened documents which I knew that comes from trusted source or were written by me
The best solution would be to sign the macro.
Go to: File -> Options -> Trust Center -> Trust Center Settings -> Macro Settings -> select Enable all macros

Digital signing of VBA project under Windows 10

Yesterday I upgraded from win 8.1 to win 10. In Outlook 2013 under win 8.1 I had a VBA script (macro) which was automatically adding BCC to every mail I have sent. This script was digitally signed so that I can have the Macro setting like this: "Notifications for digitally signed macros, all other macros disabled" without asking me to enable this macro every time I start the Outlook. Now it doesn't work any more. The script is working well if I set this macro security setting to: "Enable all macros" - but I don't want to use this setting because of security reasons.
So obviously the problem is somewhere in digital signing of the VBA script. I did it all from the beginning: I removed the previous certificate, created new one using the SELFCERT.EXE, and did all the procedure like with win 8.1 and everything went well like described here except that part in which it should ask only for the first time if I trust the publisher and I should check "always trust macros from this publisher". I cannot invoke this window. Maybe this points out to some problem or inconsistency: it should show this window for me to check it but is not showing because I previously under win 8.1 already have checked it...?
Has anybody some idea how to solve this?
Thanks!
I got it finally!
The only thing I had to do was to run Outlook as administrator. As soon as I did that, the window with "trust all documents from this publisher" appeared and after I clicked it everything after that worked like before.
I had the same issue after upgrading from Windows 7 x32 to Windows 10 but with Outlook 2010 rather than 2013. Tried all sorts of thing without success.
What eventually worked for me was to go into the Trust Center, Macro Settings, and check the box "Apply macro security settings to installed add-ins" as well as the 'Notifications for digitally signed macros' option.
The 'Disable all macros' option gets greyed out.
Click OK and exit Outlook.
Next time you open Outlook you will be asked to accept each of the installed add-ins as well as your self-certified VBA project - but this is a one-time requirement. As belt and braces I allowed it to install the certificates automatically. In my case at least, from then on all my macros ran normally :-)
Hope that helps!
I realize this thread is dated, but I discovered the reason Bzek's solution worked. I don't want to run Outlook as an Administrator, but I also did want my macros to function as they had in W7. The potential solution from Kopweb didn't work for me.
The good news is that a simple check box click in the Advanced section of the Cert properties for 'client authentication' did the trick. Restart Outlook normally and the macros should work. See the image below:
Cert - Advanced Options

Is code required to be digitally signed for Word 2010 and Excel 2010 Addins

I have built template-based add ins for Word and Excel version 2003 and previous. Those versions always required the the code to be digitally signed so that it would run on machines that had macro security turned on.
I am now working on some template based add ins for Office 2010 (to be delivered as a protected .dotm file. The add ins will create custom ribbons that provide business functionality. It looks like while I can do code signing, I no longer need to do code signing if I install my .dotm file into [user profile]\Roaming\Microsoft\Word\Startup. Can anyone verify this? In my limited testing this seems to work and I am interested in distributing this to some computers out of our domain where my code signing certificate is not trusted.
Any help would greatly appreciated. Thanks.
Yes, that has been the case since Word 97 to Word 2010 - dot/dotm files in the STARTUP folder are not checked for signing (apparently because getting them into that folder is supposed to be a manual effort). It will work without signing as long as someone has not disabled STARTUP folder add-ins (the KB on how someone would disable it is here http://support.microsoft.com/kb/921541 under section "Disable the Startup folder add-ins").