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

acrobat 9 trying to use vb to se fields gives error acroexch.app not installed

Community Beginner ,
Feb 20, 2018 Feb 20, 2018

Copy link to clipboard

Copied

how do I resolve this I have googled unti numb

TOPICS
Acrobat SDK and JavaScript

Views

2.7K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Mar 02, 2018 Mar 02, 2018

You need a reference to the correct type library. See here for more information: Where can I get the AFormAutLib.dll?

Then, you need to fix your code, it seems you are mixing up the parameters for Dim and CreateObject:

  1. Dim AFORMAUT As AFORMAUTLib.AFormApp 
  2.     Set AFORMAUT = CreateObject("AFormAut.App")

Votes

Translate

Translate
Adobe Employee ,
Feb 20, 2018 Feb 20, 2018

Copy link to clipboard

Copied

Adobe no longer supports Acrobat 9.

However make sure you that you have Acrobat Professional (or Standard) installed and not just Reader.

Votes

Translate

Translate

Report

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
Community Beginner ,
Feb 28, 2018 Feb 28, 2018

Copy link to clipboard

Copied

I have Acrobat 9 Standard installed

>

Votes

Translate

Translate

Report

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
LEGEND ,
Feb 28, 2018 Feb 28, 2018

Copy link to clipboard

Copied

Do you also have Acrobat Reader installed (Any version)?

Votes

Translate

Translate

Report

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
Community Beginner ,
Feb 28, 2018 Feb 28, 2018

Copy link to clipboard

Copied

Yes I did have reader but i uninstalled - did not fix the problem

>

Votes

Translate

Translate

Report

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
LEGEND ,
Feb 28, 2018 Feb 28, 2018

Copy link to clipboard

Copied

Try a REPAIR on Acrobat now. if not enough, try having Acrobat already running when using your code. If that still doesn’t help please tell us your code and error.

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

Here is error msg. with Acrobat running

And complete code attached

Thanks

Votes

Translate

Translate

Report

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
LEGEND ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

Please don’t try to email screen shots, we do not see them. You can come to the forum and post them or type out the text.

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

fair enough Acrobat is running and still get this error

pdferror.jpg

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

after error I quit program it closes the Acrobat window that was open

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

error is now from different line when Acrobat is open

pdferror3.jpg

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

took out bOK now error is at

pdferror4.jpg

And code does open my form and ion screen at this point

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

OK running as admin no errors with code now but but for each formfield loop doesn't see any fields

pdferror5.jpg

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

OK did post in forum new at this

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

A zillion googles later I have it working

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

To save somebody else some time, can you please share what you found.

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 04, 2018 Mar 04, 2018

Copy link to clipboard

Copied

LATEST

first fix activex error - this line fixed that

then to try and figure out I commentd out this line  AcroExchApp.Hide()

so here is complete and working code

' want to add temp table

        Dim nRowCounter As Integer

        'Create the table

        Dim Table1 As DataTable

        Table1 = New DataTable

        'Add columns to it

        Table1.Columns.Add("Id", Type.GetType("System.Int32"))

        Table1.Columns.Add("Name", Type.GetType("System.String"))

        Table1.Columns.Add("Type", Type.GetType("System.String"))

        'Add rows and fill with data

        Dim EditRow As DataRow

       

        Dim AcroExchAVDoc As CAcroAVDoc

        Dim AcroExchApp As CAcroApp

        Dim AFORMAUT As AFORMAUTLib.AFormApp

        Dim FormField As AFORMAUTLib.Field

        Dim FormFields As AFORMAUTLib.Fields

        Dim bOK As Boolean

        Dim sFields As String

        Dim sTypes As String

        Dim sFieldName As String

        Dim mycount As Integer

        ' For this procedure to work, computer must have a full version

        ' of Adobe Acrobat installed. Also, a reference to the following

        ' Type Libraries must be made:

        '     AFormAut 1.0

        '     Adobe Acrobat 7.0 (or newer)

        On Error GoTo ErrorHandler

        AcroExchApp = CreateObject("AcroExch.App")

        AcroExchAVDoc = CreateObject("AcroExch.AVDoc")

        'bOK = AcroExchAVDoc.Open(ActiveWorkbook.Path & "\" & PDF_FILE, "")

        'bOK = AcroExchAVDoc.Open("C:\PCode2017\PDFinfo\testform.pdf", "")

        AcroExchAVDoc.Open("C:\PCode2017\PDFinfo\testformold.pdf", "")

        'I have since found that to get the field lists in Acrobat 9 then

        ' AcroExchAVDOC.BringToFront and AcroExchApp.Hide need to be used.

        ' As without these the Acrobat object thinks there is no form loaded.

        AcroExchAVDoc.BringToFront()

        AcroExchApp.Hide()

        sFields = ""

        sTypes = ""

        bOK = True

        If (bOK) Then

            'AFORMAUT = CreateObject("AFORMAUT.App")

            ' now no activex error

            AFORMAUT = New AFORMAUTLib.AFormApp

            FormFields = AFORMAUT.Fields

            'FormFields = New AFORMAUTLib.Fields

            mycount = FormFields.Count

            For Each FormField In FormFields

                With FormField

                    sFieldName = .Name

                    nRowCounter = nRowCounter + 1

                    EditRow = Table1.NewRow()

                    EditRow(0) = nRowCounter

                    EditRow(1) = .Name

                    EditRow(2) = .Type

                    Table1.Rows.Add(EditRow)

                    If .IsTerminal Then

                        If sFields = "" Then

                            sFields = .Name

                            sTypes = .Type

                        Else

                            sFields = sFields + "," + .Name

                            sTypes = sTypes + "," + .Type

                        End If

                    End If

                End With

            Next FormField

            AcroExchAVDoc.Close(True)

        End If

        'Create a dataset and add this table to it

        Dim DS As DataSet

        DS = New DataSet

        DS.Tables.Add(Table1)

        Me.DataGridView1.DataSource = DS.Tables("table1")

        Debug.Print(sFields)

        Debug.Print(sTypes)

        AcroExchAVDoc = Nothing

        AcroExchApp = Nothing

        AFORMAUT = Nothing

        'Field = Nothing

        Exit Sub

ErrorHandler:

        MsgBox("FieldList Error: " + Str(Err.Number) + " " + Err.Description + " " + Err.Source)

    End Sub

works great - now on to creating code to fill the form

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

You need a reference to the correct type library. See here for more information: Where can I get the AFormAutLib.dll?

Then, you need to fix your code, it seems you are mixing up the parameters for Dim and CreateObject:

  1. Dim AFORMAUT As AFORMAUTLib.AFormApp 
  2.     Set AFORMAUT = CreateObject("AFormAut.App")

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 02, 2018 Mar 02, 2018

Copy link to clipboard

Copied

can't use set -if I typr that in VS2005 it deletes it

Votes

Translate

Translate

Report

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