Quantcast
Channel: Adobe Community : Unanswered Discussions - Acrobat
Viewing all articles
Browse latest Browse all 73766

How to merge PDF and html using vba

$
0
0

I've successfuly implemented code to merge multiple PDFs.  However when pointing to an HTML file, my code seems to leave it out and continue to merge the rest of the PDF files.  What am I doing wrong with my code?

 

Dim objCAcroPDDocDestination As acrobat.AcroPDDoc

Dim objCAcroPDDocSource As acrobat.AcroPDDoc

dateFormat = Format(Now, "mmddyy")

dateformat2 = Format(Now, "mm-dd-yyyy")

Dim sourcefile As String

'Initialize the objects

Set objCAcroPDDocDestination = CreateObject("AcroExch.PDDoc")

Set objCAcroPDDocSource = CreateObject("AcroExch.PDDoc")

 

 

'Open Destination, all other documents will be added to this and saved with

'a new filename

objCAcroPDDocDestination.Open ("location\Daily.pdf")

 

'Do your loop here to open subsequent documents that you want to add

'Do

  'Open the source document that will be added to the destination

   'objCAcroPDDocSource.Open (location & "07-" & "032613" & ".pdf")

  For count = 2 To 13

    If count < 10 And count <> 5 Then

        objCAcroPDDocSource.Open (location & "0" & count & "-" & dateFormat & ".pdf")

 

    Else

        objCAcroPDDocSource.Open (location & count & "-" & dateFormat & ".pdf")

    End If

   

    If count = 5 Then

        objCAcroPDDocSource.Open (location & "0" & count & "-" & dateFormat & ".html")

    End If

   

    If objCAcroPDDocDestination.InsertPages(objCAcroPDDocDestination.GetNumP ages - 1, objCAcroPDDocSource, 0, objCAcroPDDocSource.GetNumPages, 0) Then

       

    Else

        '0 problem

    End If

    objCAcroPDDocSource.Close

 

  Next count

 

 

'loop

 

objCAcroPDDocDestination.Save 1, location & dateformat2 & "-Daily.pdf"

objCAcroPDDocDestination.Close

Set objCAcroPDDocSource = Nothing

Set objCAcroPDDocDestination = Nothing


Viewing all articles
Browse latest Browse all 73766

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>