1 Reply Latest reply on Jul 31, 2009 6:44 AM by setondeveloper

    Error creating "AcroExch.PDDoc" from VB.NET code


      I am using the sample project "JSObjectAccessVB" from the Acrobat 9 SDK samples.  The following line gives an error:

           srcDoc = CreateObject("AcroExch.PDDoc")

      The error message is:

           Unable to cast COM object of type 'System.__ComObject' to interface type 'Acrobat.CAcroPDDoc'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9B4CD3E7-4981-101B-9CA8-9240CE2738AE}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).


      I tried replacing the above line of code with the following:

              Dim clsID As Guid = New Guid("{FF76CB60-2EC8-101B-B02E-04021C009402}")
              Dim pdDocType As Type = Type.GetTypeFromCLSID(clsID)
              srcDoc = Activator.CreateInstance(pdDocType)
      but in this case, the call to Activator.CreateInstance never returns - the execution just hangs there.


      My OS is Windows XP Professional - using Visual Studio 2005.  Acrobat 7.0 Professional is installed; I'm fairly certain that the above code does not require any modification between Acrobat versions 7 and 9.


      Suggestions anyone?