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

Quote:
Change your code as follows:
Code:
Private Sub LstfileBx_Click()
txtFolderPath.Text = LstfileBx.Text
xStrData = ""
Set RegExp = CreateObject("VBscript.RegExp")
RegExp.Global = True
RegExp.Pattern = "/Type\s*/Page[^s]"
xFileNum = FreeFile()
Open txtFolderPath.Text For Binary As #xFileNum

xStrData = Space(LOF(xFileNum))
Get #xFileNum, , xStrData
Close #xFileNum
txtNoOfPAgesPDF.Text = RegExp.Execute(xStrData).Count
End Sub
Rectified it as per your say. But you have taken the following syntaxes before
txtFolderPath.Text = LstfileBx.Text
xStr = ""
May i know Why
Thank you
SamD
Reply With Quote