Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Generating "msoult.h" from "msoutl.olb" using VS2005

Generating "msoult.h" from "msoutl.olb" using VS2005

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eight
    wrote on last edited by
    #1

    Hi. I'm trying to write a program that automates outlook 2007 using c++. Found some samples, all requires "MSOUTL.H". How do I generate "MSOUTL.H" from my "MSOUTL.OLB"? I'm using VS2005 and Outlook 2007.

    S 1 Reply Last reply
    0
    • E eight

      Hi. I'm trying to write a program that automates outlook 2007 using c++. Found some samples, all requires "MSOUTL.H". How do I generate "MSOUTL.H" from my "MSOUTL.OLB"? I'm using VS2005 and Outlook 2007.

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      Can I make a suggestion - rather than using whatever you are using to try and automate Outlook, use #import to do automation in C++ - it's the simplest and easiest way. Here's how I automate Excel 2007 (getting the active workbook name in this case) - automating Outlook just requires you to determine Outlook's libid (which, from the OLE COM object viewer, is 00062FFF-0000-0000-C000-000000000046):

      #include <iostream>
      #include <Windows.h>
      #import "libid:00020813-0000-0000-C000-000000000046" version("1.6") auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")

      int main()
      {
      CoInitializeEx(0, COINIT_APARTMENTTHREADED);
      // Ensure the Excel::_ApplicationPtr is destructed before we uninitialize COM.
      {
      Excel::_ApplicationPtr xl;
      if (SUCCEEDED(xl.GetActiveObject(__uuidof(Excel::Application))))
      {
      std::cout << "Getting name\n";
      std::cout << xl->ActiveWorkbook->FullName << std::endl;
      }
      }
      CoUninitialize();
      return 0;
      }

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups