Search code examples
c++commsdnoffice-automation

Where can I find the MS Office Interfaces to do some automation in C++ and COM


I have found the file MSPPT.OLB, but not able to open it with Oleview.exe.

Isn't this documentation there on MSDN, all I can find is C# interfaces. (May be I have missed/ or not a very good user of google)


Solution

  • Look for .OLB files. E.g., for Office 2010:

    C:\Program Files (x86)\Microsoft Office\Office14>dir *.olb
    
     Directory of C:\Program Files (x86)\Microsoft Office\Office14
    
    10/20/2010  03:36 PM           677,248 MSACC.OLB
    03/22/2010  08:29 PM           417,144 MSOUTL.OLB
    03/08/2010  06:23 PM           402,824 MSPPT.OLB
    03/26/2010  08:52 PM           901,464 MSWORD.OLB
    

    Also: C:\Program Files (x86)\Common Files\microsoft shared\OFFICE14\MSO.DLL

    With some tweaks, you can use MSVC++ #import detective to generate C++ wrappers:

    #import "TypeLib\MSWORD.OLB" \
      raw_interfaces_only, \
        rename("ExitWindows","MsoExitWindows"), \
        rename("FindText","MsoFindText"), \
      named_guids