IF THEN ELSE - identify number of pages of pdf (1 Viewer)

lhanes72

Registered User.
Local time
Yesterday, 22:19
Joined
Dec 2, 2008
Messages
31
I need help with this code.

What I want to do is associate the Check.pdf file with the value "Test1" and determine if it has a certain number of pages to open one file; and if not to open a different file. I'm not even sure if I HAVE to open Test1 in order to count the number of pages. That's what the FollowHyperlink command is doing, is that correct?

Dim Test1 As String

Test1 = "C:\Check.pdf"

FollowHyperlink Test1
If Test1.Pages = 6 Then
Sourcex.Open ("C:\Filea.pdf")

Else
Sourcey.Open ("C:\Fileb.pdf")
End If

Thanks for the assistance.
 

the_net_2.0

Banned
Local time
Yesterday, 22:19
Joined
Sep 6, 2010
Messages
812
what you need to be doing here is using the adobe acrobat vba REFERENCE and seeing if there are any methods and/or properties associated with the number of pages in a document. I know for a fact that you can get to pdf documents as actual OBJECTS when you use these references. the rest of it is up to you via google or manually checking the intellisense.
 

Users who are viewing this thread

Top Bottom