0

Any ideas, i have made a previous post about this but i got no replys which gives mthe impression i am doing it wrong

Any tips on how to do this?

essentially i want to automate outlook like this ...

    Outlook.Application app = null;


    if (Process.GetProcessesByName("OUTLOOK").Count() > 0)
    {
        app = (Microsoft.Office.Interop.Outlook.ApplicationClass)(Marshal.GetActiveObject("Outlook.Application"));
    }

this gives me a outlook object, but what method calls are needed to be able to run a particular macro?

Thank you

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
tom
  • 4,911
  • 11
  • 37
  • 39
  • possible duplicate of [Issues with calling an outlook macro from c#](http://stackoverflow.com/questions/4156195/issues-with-calling-an-outlook-macro-from-c) – Binary Worrier Nov 12 '10 at 11:03

1 Answers1

0

My answer to your original question:

I thik you're doing it right, but maybe you don't meet the security requirements! In order to run a macro, the office file needs to be a trusted source! It must be flagged via the Office Security Center or else you won't be able to execute macros. You also need to allow access to the VBA Object via the security center for an external app to call the macros!

Falcon
  • 3,150
  • 2
  • 24
  • 35
  • Yes, i did try this too! all of the outlook security settings for programmtic access and macro security have been turned down to the lowest setting possible. I will try allowing the vba object access now. Than you Falcon – tom Nov 12 '10 at 11:48