• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Open Pdf files through Macro

Abhijeet

Active Member
Hi
I have in folder 30 to 50 Pdf files i want one by one open pdf files.If i Run Macro then from that folder i want to open 1 pdf file when i close that file then open 2nd Pdf file like this.So please help in this
 
Hi Abhijeet!

It can be solve by using macro / VBA..
We just need two more information to proceed..
  • How many word in the each of the pdf file..
  • What is your reading speed (like number of words / hour)
Then a normal calculation.. you dont even need to close the file.. it also can be done using VBA..
 
This doesn't sound like the kind of thing that should be automated, in my opinion. People will have different reading speeds, and they might want to take a break and come back to read the file later. I would suggest instead, create a table of contents (aka, a list) in either XL or Word with hyperlinks to the different PDFs. Then the user can pick the file they want, read it at their own speed, and then continue to next one when they want to.
 
Ok Luke M can u give me macro for hyper link.folder path i can give then macro give me hyperlink of that particular folder files
 
Make sure you change the folder path to the appropriate path.
Code:
Sub CreateHyperlinks()
'Creates a Table of Contents (ToC) in active sheet of PDFs in specified folder
Dim myFolder As String
Dim fName As String
Dim myArry As Variant
Dim fPath As String
Dim recCount As Long


'Where are the files located?
myFolder = "C:\My Documents\"

'Make sure that final slash mark was added
If Right(myFolder, 1) <> "\" Then
    myFolder = myFolder & "\"
End If
   
fPath = Dir(myFolder & "*.pdf")


'Create ToC on active sheet, starting in row 1
recCount = 0
Application.ScreenUpdating = False

'Loop through all the files, building Hyperlink formulas
Do Until fPath = ""
    recCount = recCount + 1
    Cells(recCount, "A").Formula = "=HYPERLINK(""" & myFolder & fPath & """,""" & fPath & """)"
    fPath = Dir()
Loop
Application.ScreenUpdating = True

'Brief message to user
MsgBox "Number of files found: " & recCount, vbOKOnly, "Files found"
End Sub
 
Hi Luke M this is work but tell me one more thing when i run 2nd time macro that time i want clear all data then give next result how to do this
 
You want to clear the ToC? Add this line at beginning of macro:
ActiveSheet.Cells.ClearContents
 
Back
Top