2

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)

  • tried opening EXCEL.EXE etc. as type library? – M.M Jul 14 '14 at 09:19
  • no.. i still get the same error, `MkParseDisplayName(...) failed. Invalid Syntax (MK_E_SYNTAX) ` and then `the command line POWERPNT.EXE does not contain valid persistent OLE object ProgID or Type Library File (TYPE_E_CANTLOADLIBRARY)` –  Jul 14 '14 at 09:38
  • Read the error message. It says that you are trying to look in POWERPNT.EXE. Wrong file. Oleview.exe was borken for a while, iirc in SDK version 7.0 (VS2010 vintage). It doesn't help you anyway, use the #import directive in a C++ program to import the type library. Using C# to interop would be wise, you'll find a wholeheckofalot more help and have to write a lot less code. – Hans Passant Jul 14 '14 at 10:56
  • @HansPassant thanks for advice, but want to do some adventure.. so plain C++ with COM will teach me a lot, i think. Also don't know C# at all so efforts are going to be almost same. So #import is one of the option. But still I would prefer writing raw COM program –  Jul 14 '14 at 11:35

1 Answers1

1

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
noseratio
  • 59,932
  • 34
  • 208
  • 486
  • 1
    The odds that this #import directive is going to help him are zero. Starting with the wrong path and the wrong type library. You have to give the guy a chance to find a match with Google hits, the smart pointers and _com_error are important to keep him out of trouble. – Hans Passant Jul 14 '14 at 11:01
  • @HansPassant, I encourage the OP to explore the power of `#import` on his own. Here I just pasted what once worked for me. – noseratio Jul 14 '14 at 11:07
  • @Noseratio, with .olb files also I get the same errors, so can't open them with `Oleview.exe`. Will try #import directive and update about the result here. Thanks. –  Jul 14 '14 at 11:36
  • @oh_dear_i_love_coding, just copy `MSPPT.OLB` and `MSO.DLL` to a subfolder of your project and reference it with `#import` from there. Note `raw_interfaces_only`, it will give you raw COM interfaces if that's what you prefer. – noseratio Jul 14 '14 at 11:44
  • 1
    @Noseratio thank you sir, that helped a lot. Have not done automation yet, but i think i got the idea how to achieve that. Thanks –  Jul 30 '14 at 11:37
  • 1
    Have done the automation also.. and it works..! thanks a lot again!! –  Aug 08 '14 at 13:42