Office Addin gettin disabled if network drive is inaccessable - outlook-addin

I have an outlook addin which is located on the network drive for all users to use.
When network fails may it be because of a cable that plugged out, or a system issue, if at that moment, the user launches Outlook (when no network is available), outlook automatically ticks off the addin out of usage.
For as long as the user doesn't enable it back, the add-in will not load. ever. you can close outlook , reopen it, it won't load the addin if it failed to find the .VSTO file once when outlook started.
Setting the registry value to never disable the addin, isn't effective here, because the addin is not realy disabled, its only been shut off and waiting to be reactivated manually.
I would like it to stop being shut off, or at least auto-enable it self when network is accessible. can this be accomplished without an 3rd party exe running in the background ?

Put the addin locally to each computer and equip those computers with simple script which runs on user logon and copies the addin from its network location to local directory. This will keep your addin both updated and always available.
In case if the network is inaccessible, it is the script (invisible to user), which will fail, not the Outlook. This makes a difference :)
Of course, besides the initial launch of the script, there are also possibilities to re-run it on regular basis (once a day?) when a user is logged on. This will be be effective only when Outlook is not running at the moment, otherwise the addin DLL cannot be overwritten.

It is not a good idea run from a network drive. Why not copy the dll locally when you install your addin?

Why not install locally and then write code to check the network location? If the network is available, compare the remote dll to the local one. If they are different, copy the new dll to the local machine, then adjust the registry entries for that addin. Then display a message to the user to restart the application.

Related

Redemption Outlook VBA reference always getting reset in Citrix

Every time I enable the Redemption Outlook library in my Access VBA (tools -> references), it seems to get reset when I log out of Citrix. Is there any way to keep it as a persistently-added reference like the others?
It probably means the HKCU registry gets reset. Try to register Redemption with regsvr32.exe from an elevated command prompt - it then will install itself in HKCR.
It's more likely that the registry entry for this reference simply isn't getting saved permanently when Citrix exits. Talk to your Citrix admin about adding the registry entries permanently. Otherwise, rather than running your Access app directly in Citrix, consider running a script in Citrix (vbscript or Powershell) which adds the reference for this to the registry at runtime and then starts your app.

Office Addin On-Send Feature

I am currently having problems with the on-send feature on some desktop clients. I have implemented an addin but for some desktop clients emails are blocked from being sent. The email hangs and does not get sent. Is there a way to use on-send by disable for desktop clients. Can i do this in the manifest file or in powershell? Is it even possible to disable on-send for specific platforms. I want to configure my addin to never block emails. I suspect emails are blocked because event.completed() close as expected on some Desktop clients.
This is a new thing since the on-send never worked on desktop clients before. Now that it does...i have to deal with this bug somehow
There is no way to disable an add-in for just desktop clients. It is either enabled for all Win32, Mac and OWA, or off for all. This is true of all add-ins not just OnSend. Though previously this feature was not enabled for Desktop clients, it now is.
Note to unblock e-mails you should be calling event.completed({allowEvent:true}); (or false) to block e-mails. See: https://learn.microsoft.com/en-us/javascript/api/office/office.addincommands.event?view=word-js-preview
What is your scenario that you need to disable this for Desktop but NOT OWA?
You could also detect what platform you are on an change behavior of your add-in as necessary.
But the event.completed({allowEvent:true}); also have problem.
For example:
If I install a com app on Outlook then install an on-send add-in.
The problem is, if they both have simultaneous response on-send event. It will stack in an infinite loop.
As an add-in developer, the root cause looks like, event.completed({allowEvent:true}) not only end add-in but also send an 'send' event out. This will trigger a non self sending event response.

MAPIInitialize fails when running as a service and when Outlook is open

We have an application that can run as a Windows service (or as a user mode app). As part of it's processing, it launches a second executable that interacts with MAPI to read the contents of an MSG file. The executable is 32 bit. Office is 32 bit. So far, we've only tested using Outlook 2013.
This has worked fine for quite some time, but we've recently discovered a corner case where things do not work.
When we run as a Windows Service, and Outlook is not running in the user's session, then the application runs properly. However, if we launch Outlook, then MAPIInitialize fails with a return code of -7 (0xfffffffd).
I've tried calling with and without the MAPI_NT_SERVICE flag added (honestly, I can't figure out what that flag actually does), but it makes no difference.
So far in our testing, the Windows service account has been the same as the user logged into the Windows session that has Outlook installed - not sure if that might be important or not.
I can't for the life of me figure out how a process running under one session could interfere with a process running in another session.
I found this post a few minutes ago: https://social.msdn.microsoft.com/Forums/office/en-US/7a9cc40a-ffd6-4f83-9973-5410615b4df4/mapi-working-when-accessed-from-normal-application-but-not-from-the-service?forum=outlookdev
I'll give that a shot, but it seems super unlikely that this could be the issue (it's not like we do anything different with COM initialization, and certainly that wouldn't have anything to do with whether Outlook was running or not).
Can anyone point me in direction(s) to pursue this?
=============
More interesting information:
This appears to only happen with Outlook 2013. It definitely does not happen with Outlook 2010.

Why might COM automation of Word from within a console application run as a scheduled task work on my development machine but hang on another?

I have a console application that uses COM automation to manipulate .DOC and .DOCX files in Word 2010. This works in a scheduled task for a not logged in user account on two development machine (running 32 bit Windows Server 2003) but not on another machine (running 64 bit Windows Server 2003). It does run on that machine if run from the command line by the same user account when logged in (so I don’t think it’s a 32/64 bit issue).
The code hangs at the point it tried to open a document not when the Word application is created.
I have logged in as the user account and opened the file manually (so I don’t think it is popping up any dialog boxes).
I thought that it might be something to do with autocorrect and while looking at the proofing options noticed that the “automatically use corrections from the spelling checker” checkbox is greyed out.
I have used process monitor and could not find any file access failures for files which are on the dev machine but not on the other (Word seems to look for Normal.dot in a number of places but this file in not on the dev machine either).
I am aware that Word automation on a server is not recommended or supported by Microsoft and may be outside the terms of the license.
I am using automation as I need to manipulate files for older versions of Word.
This may be related to my other issue with automation from non logged in accounts: Why might COM automation from within a console application work on my development machine but not on another? However this case is different in that opening a file is hanging rather than creation of the application program failing.
What else should I try?

How to detect the running process in Wix3?

I'm using wix3 to build a setup file, I would like to know whether the outlook is running during the installation. If the outlook is still running, the setup should notify the users to close it or have to reboot after the installation.
I noticed that there is a feature can send a message to close the outlook directly, but that's not very friendly. I would like to knwo whether the FileInUse dialog can be called in such situation.
Thanks.