Skip to Content
author's profile photo Former Member
Former Member

Call a virtual MS Outlook via OLE

Hi Guys,

I need help on calling MS Outlook via OLE. It is MS Outlook 2010. The li_rc = oleOutlook.ConnectToNewObject("Outlook.Application") returns -2 which indicates "Class name not found". I also tried li_rc = oleOutlook.ConnectToNewObject("Outlook.Application.14"), the same value returned (-2).

When outlook is installed locally, then the code runs fine. How do we call if it's a virtual application (using APP-V).

Thanks,

Neil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 11, 2014 at 01:26 AM

    App-V isolates the running application in a sandbox. You can't talk to it. You should look at other means (e.g., SMTP) to send email if that's what you were using Outlook for.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Bruce. The requirement is to just display the Outlook Client window with a pre-attached document but not send the email yet. The user will send the email manually as they still have to type more texts on it. And they also want to have a copy of the email on their Sent folder. I'm working for three different clients with different environments. In one client the code is working fine, on the other two, they're having issues.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2014 at 12:19 PM

    Don't know APP-V but if it simulates a Virtual host, you can

    try to use ConnectToNewRemoteObject (hostname,"Outlook.Application")

    Regards.

    Abdallah.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Abdallah. It's one of the challenge for me to find out the hostname. The client is a remote client and their IT Infrastructure is kind of security tight. The hostname could also change at any point in time as per their IT Architecture. So, it's kind of hard to figure out a solution.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.