3

My program allows users to copy/paste whole emails from their Outlook client into my software. If my program runs as a local program I can basically us the following code to access the running Outlook instance and continue code logic from there:

Dim OL As Microsoft.Office.Interop.Outlook.Application 
OL = Microsoft.VisualBasic.Interaction.GetObject(, "Outlook.Application")

However, if my program runs as a RemoteApp I fail to access (from there) the local Outlook instance (the Outlook running locally on the users machine).

Trying something like this fails:

OL = Microsoft.VisualBasic.Interaction.GetObject("\\tsclient\c\Program Files\Microsoft Office\root\Office16\outlook.exe", )

This will throw an ActiveX exception. Path is correct and accessible.

How can I access that instance of Outlook from the RemoteApp?

Any help is greatly appreciated!

Gorion
  • 31
  • 1
  • Do the users execute Outlook from the UNC path? – djv Dec 22 '21 at 17:06
  • sorry for the late reply djv. no they don't they run their local outlook. its really only my remote app that is running on the rdp session. therefore, my usual approach searches for an outlook instance on the server (on the rdp session of the user), but should look for the instance running on the client's machine. I might also provide Outlook as a RemoteApp, then the two programs will likely be able to talk to each other. However, that brings other drawbacks to the user. I would prefer that only my program runs as a RemoteApp. – Gorion Dec 23 '21 at 10:53
  • As I have full control over client Pc's (employee PC's) I have now written a little helper utility that runs on client machines and checks "signal" files using FileSystemWatcher class and upon signal provides the necessary email as a file for the RemoteApp to import. Works a charm, buts it's somewhat exuberante for what I wanted to achieve. – Gorion Jan 03 '22 at 15:11

0 Answers0