Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

OLE Interapplication communication problem in C#

New Here ,
Feb 16, 2017 Feb 16, 2017

I've been struggling with this for days, cannot make it work. I have a c# app, and I want to open a document in Acrobat Reader, or just get the instance of a document that is already opened in an Acrobat Reader (both ways will be fine). Then I need to know when that document is closed, an event will be perfect, but any other way will be fine too. Acrobat Reader may still be running showing other documents, I just need to know when one particular document is closed.

I tried several approaches, but none seems to be working.

- By referencing AcroPDFLib I cannot do anything at all. It contains just interfaces.

- I also tried OLE IAC: getting type by ProgId works

      Type acrobatType = Type.GetTypeFromProgID("AcroExch.Document.DC")

  but then Activator.CreateInstance(acrobatType) only works when there is no Acrobat Reader running (obviously), but does not show Acrobat Reader, it just creates the instance in memory. There might be a method to show the window, but I don't know where to find it.

Any help or working code example will be appreciated!

626
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation