Link to home
Start Free TrialLog in
Avatar of Diaphanosoma
Diaphanosoma

asked on

Join multiple pdf documents in vb script

Hi,

I have vb script to join two pdf documents together. Works great. I can't seem to expand the code to join three (or more) pdf docs together. Each pdf is one page.

I have
Dim Doc1
Dim Doc2
Dim Doc3

Set Doc1 = CreateObject("AcroExch.PDDoc")
Set Doc2 = CreateObject("AcroExch.PDDoc")
Set Doc3 = CreateObject("AcroExch.PDDoc")



file1 = Doc1.Open("C:\ods_outputs\alc_daily_summary_tables.pdf")
file2 = Doc2.Open("C:\ods_outputs\discharge destinations.pdf")
file3 = Doc3.Open("C:\ods_outputs\alc_daily_graphs.pdf")
Stack = Doc1.InsertPages(Doc1.GetNumPages - 1, Doc2, Doc2.GetNumPages,0, Doc3, 0, Doc3.GetNumPages,0)

SaveStack = Doc1.Save(1, "C:\Users\LB\Desktop\Daily v2.pdf")

I get error: wrong number of arguments or invalid property assignment.
I can't find the meaning of the arguments...If you could explain them, that would help.

Can you help me straighten this out.

Thanks,

Bruce
ASKER CERTIFIED SOLUTION
Avatar of agonza07
agonza07
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Diaphanosoma
Diaphanosoma

ASKER

I'll give it a go. I thought trying that last night... but it seemed "lame".
Points for everyone. Agonza gets more for being up so late!