Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6/VBA access to PDF Metadata

Status
Not open for further replies.

joopa

Technical User
Sep 9, 2002
26
0
0
US
Hey,
I want to access the metadata or just the file properties of an Adobe PDF document. This is to read the title/autohr etc into a test string and then print a barcode.

Any suggestions? Prefer using VB6 or VBA, don't have any .NET.

THANKS!
J
 
had this lying around...
Code:
Function ReadPDF(ByVal sFile As String) As Boolean
  Dim oDoc As Object ' Acrobat.CAcroPDDoc
  
  Set oDoc = CreateObject("AcroExch.PDDoc")
  With oDoc
    If .open(sFile) Then
      msFileName = .GetFileName
      mnNumPages = .GetNumPages
      mnPageMode = .GetPageMode
      msTitle = .GetInfo("Title")
      msSubject = .GetInfo("Subject")
      msAuthor = .GetInfo("Author")
      msKeywords = .GetInfo("Keywords")
      msCreator = .GetInfo("Creator")
      msProducer = .GetInfo("Producer")
      .Close
      ReadPDF = True
    Else
      ReadPDF = False
    End If
  End With
  
  Set oDoc = Nothing
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top