Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PDF Information


Hi All,

I am relavtively new to VBA and I have a problem. I would like to go
through a folder that contains a number of .PDF files and extract the
document name and the the title. Extracting the name of the file is
easy but how can I extract the title. The title can be found by
right-clicking on the file and selecting the PDF tab. I would likt to
produce a list in excel with the file name in one column and the
corresponding 'title' (information) in the adjacent column. Thank you.


--
NSKearns
------------------------------------------------------------------------
NSKearns's Profile: http://www.excelforum.com/member.php...o&userid=36948
View this thread: http://www.excelforum.com/showthread...hreadid=566585

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default PDF Information

Hi NSKearns,

Sub EnumPdfFile()
Application.ScreenUpdating = False
Workbooks.Add
Const sPath$ = "Path of the directory to be explored"
Dim PathEntry$, w%
PathEntry = Dir(sPath & "\*.*", vbNormal + vbHidden)
While Len(PathEntry)
If PathEntry < "." And PathEntry < ".." Then
If LCase(Mid(PathEntry, InStr(1, PathEntry, ".") + 1)) = "pdf" Then
w = w + 1
Cells(w, 1) = PathEntry
Cells(w, 2) = PdfTitle(sPath, PathEntry)
End If
PathEntry = Dir()
End If
Wend
Columns("A:B").Columns.AutoFit
End Sub

Private Function PdfTitle$(iPath$, iFile$)
With CreateObject("Shell.Application").NameSpace(CStr(i Path))
PdfTitle = .GetDetailsOf(.ParseName(iFile), 10)
End With
End Function

Regards,
MP


"NSKearns" a écrit
dans le message de news:
...

Hi All,

I am relavtively new to VBA and I have a problem. I would like to go
through a folder that contains a number of .PDF files and extract the
document name and the the title. Extracting the name of the file is
easy but how can I extract the title. The title can be found by
right-clicking on the file and selecting the PDF tab. I would likt to
produce a list in excel with the file name in one column and the
corresponding 'title' (information) in the adjacent column. Thank you.


--
NSKearns
------------------------------------------------------------------------
NSKearns's Profile:
http://www.excelforum.com/member.php...o&userid=36948
View this thread: http://www.excelforum.com/showthread...hreadid=566585



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PDF Information


Thank you for the quick reply. The macro worked magnificently.

Thank you.


--
NSKearns
------------------------------------------------------------------------
NSKearns's Profile: http://www.excelforum.com/member.php...o&userid=36948
View this thread: http://www.excelforum.com/showthread...hreadid=566585

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table cutting information of a part of the information ASR Excel Discussion (Misc queries) 1 November 5th 09 02:09 PM
Help!! using sheet 1 information to change information on sheet 2 I want to learn more Excel Worksheet Functions 2 September 30th 08 05:25 PM
Information Jessica Ikerionwu Excel Discussion (Misc queries) 4 June 13th 07 11:30 PM
LOOK UP INFORMATION Geoff Excel Worksheet Functions 1 February 9th 06 06:19 PM
Information from one cell pulls information from another cell ACTLibrarian Excel Programming 1 November 13th 04 04:01 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"