🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18760

Re: VB: Get the value of the Label from a selected TextFrame

#18760
From: Robert Potschka
Date: Tue, 04 Mar 2003 00:03
35 lines
1697 bytes
Dennis,

if you want to get to the field directly then I am using the Adobe JavaScript object. It requires late binding but it saves looping:

Open your pdf document and then set the pdf object to a variable

gPDFPath = App.Path & "\" & txtFileName.Text & ".pdf"

'If a file is selected, try to open it
If Len(gPDFPath) > 0 Then

'Show acribat if it's hidden
    gApp.Show

' create PDDoc object
    foundErr = False
    Set gPdDoc = CreateObject("AcroExch.PDDoc")

' open the PDF in acrobat
    If gPdDoc.Open(gPDFPath) Then
        gPdDoc.OpenAVDoc ("")
    Else
        MsgBox "Failed to open " & gPDFPath
    End If
End If

Set jso = gPdDoc.GetJSObject

Once the above code has the object you can reference the fields without looping like so...

Msgbox jso.getfield("Oper_Name").Value

You can change the Property (Value) to almost anything as stated in the Javascript help file that comes with Adobe Acrobat 5 (full version)

Rob.
Technical Details
Message-ID: <1de811da.6@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de811da.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,2d2312c5afbdac7f
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-03-03 16:08:04 PST
From: "Robert Potschka" <eformx@telus.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: VB: Get the value of the Label from a selected TextFrame
Message-ID: <1de811da.6@WebX.la2eafNXanI>
Date: Mon, 3 Mar 2003 16:03:41 -0800
References: <1de811da.-1@WebX.la2eafNXanI>
Lines: 38
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit