I've never used the VBScript function NeoBook.
I try to use the following code, but does not.
By plainement against it functions in Excel.
The goal is to count the number of pages in PDF files in a folder.
Can you help me.
Thank you.
Code: Select all
'Function GetPageNum(PDF_File As String)
Dim PDF_File 'as string
Dim FileNum 'As Long
Dim strRetVal 'As String
Dim RegExp
Set RegExp = CreateObject("VBscript.RegExp")
RegExp.Global = True
RegExp.Pattern = "/Type\s*/Pages"
FileNum = FreeFile
Open PDF_File For Binary As #FileNum
strRetVal = Space(LOF(FileNum))
Get #FileNum, , strRetVal
Close #FileNum
GetPageNum = RegExp.Execute(strRetVal).Count
publication.nbSetVar "[PDFNombrePages]", GetPageNum
End Function
Bonjour à tous,
Je n'ai encore jamais utilisé la fonction VBScript de Neobook.
J'essaie d'utiliser le code suivant, mais ne fonctionne pas.
Par contre il fonctionne plainement dans Excel.
Le but est de compter le nombre de pages contenues dans les fichiers PDF d'un dossier.
Sauriez-vous m'aider.
Merci.