View Single Post
 
Old 05-24-2021, 09:03 PM
SamDsouza SamDsouza is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Aug 2019
Posts: 71
SamDsouza is on a distinguished road
Default

Thanks Guessed

First of all Let me tell you. I've been able to rectifcy the Error as i missed some important syntaxes and now i am able get the Page nos correctly in textbox

Correction on Bad File Number is rectified as below
Code:
Private Sub LstfileBx_Click()

Set RegExp = CreateObject("VBscript.RegExp")
RegExp.Global = True
RegExp.Pattern = "/Type\s*/Page[^s]"
xFileNum = FreeFile

txtFolderPath.Text = LstfileBx.Text
          
 Open txtFolderPath.Text For Binary As #xFileNum
          xStrData = Space(LOF(xFileNum))
          Get #xFileNum, , xStrData
      Close #xFileNum
 txtNoOfPAgesPDF.Text = RegExp.Execute(xStrData).Count
End Sub
Quote:
What program are you running the code in - Is this Word 2013?
Yes Windows 10 and MS Office Home and Student 13 so word 13

Quote:
If you used Word to run the code, do you want Word to open the PDF and does it matter if this changes the pagination?
I don't mind word to Open the PDF. But i don't want its effect as Online conversion like PDF to Word
Would Prefer for the original Pagination . But you can recommend

Quote:
What is the point of the PDF view function - what are you going to do with the page?
Rather than Opening Each individual PDF file thought of having minor replica of Each PDF Page in the image box
Thanks
SamD
Reply With Quote