Solved

Insert PDF as page 2 on a report

Posted on 2014-01-30
2
430 Views
Last Modified: 2014-02-01
I have a 2 page report.  On page 2 I want to insert a PDF file.  Can this be done?
0
Comment
Question by:SteveL13
2 Comments
 
LVL 10

Expert Comment

by:Gozreh
Comment Utility
You can insert an Unbound object into your report and select your Adobe file.
But you will only see the first page, with other limitations.

Best option will be to send your report to pdf, and combine it with your second pdf file.
0
 
LVL 1

Accepted Solution

by:
SarahDaisy8 earned 500 total points
Comment Utility
I used this code to merge two PDF's from 2 reports into one PDF. You can modify the numpages to be 2 (test it out) to make sure it goes in between it's pages.  Don't forget to add the Acrobat (not sure of the exact title) reference so that it recognizes the object you are calling.  


Public Function Combine(FileSave As String, summary As String, Detail As String)
Dim AcroApp As Acrobat.AcroApp
Dim SumfileName As Acrobat.CAcroPDDoc
Dim detailfileName As Acrobat.CAcroPDDoc
Dim numPages As Integer
Set AcroApp = CreateObject("AcroExch.App")
Set SumfileName = CreateObject("AcroExch.PDDoc")
Set detailfileName = CreateObject("AcroExch.PDDoc")
SumfileName.Open (summary) 'Page 1 File directory location
detailfileName.Open (Detail) 'Page 2 file directory location


'COMBINES MULTIPLE PDF PAGES INTO ONE PDF FILE


' Insert the pages of Part2 after the end of Part1
numPages = SumfileName.GetNumPages()
If SumfileName.InsertPages(numPages - 1, detailfileName, 0, detailfileName.GetNumPages(), True) = False Then
MsgBox "Cannot insert pages"
End If

If SumfileName.Save(PDSaveFull, FileSave) = False Then
MsgBox "Cannot save the modified document"
End If

SumfileName.Close
detailfileName.Close
AcroApp.Exit
Set AcroApp = Nothing
Set SumfileName = Nothing
Set detailfileName = Nothing

End Function

Open in new window


Sarah
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now