By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Visual Basic 6.3 help copy a pdf page

P: 1
Hello and thanks for your help,
I am using Word and Visual basic 6.3, I am not a professional programmer but have gotten some basic stuff done using help menus and books however finding anything referring to pdf code is hard. The VB help lib. is pretty much useless and I have bought a few books but they too do not explain how to code pdfs. This is my problem. I am copying a jpeg to a PDF and I would like to copy a page in the pdf and past to a word doc. Here is my code:
Sub adobe_Copy_Paste()
Const DOC_FOLDER As String = "C:\"
Dim objCurrent
Dim strFormName As String
Dim blnNeedToClose As Boolean
Dim AcroApp As CAcroApp
Dim avCodeFile As CAcroAVDoc
Dim avFormCapture As CAcroAVDoc
Dim pdCodeFile As CAcroPDDoc
Dim pdFormCapture As CAcroPDDoc
Dim lngPage As Long
Dim AVPage As CAcroAVPageView
Dim PDPage As CAcroPDPage
'Start Acrobat in the background
Set CAcroApp = CreateObject("AcroExch.App")
'Uncomment the following line to watch the program run
Set CavCodeFile = CreateObject("AcroExch.AVDoc") 'This is the code file
Set CavFormCapture = CreateObject("AcroExch.AVDoc") 'This will be each jpg in turn
CavCodeFile.Open DOC_FOLDER & "\report.pdf", "Steves File"
Set CpdCodeFile = CavCodeFile.GetPDDoc
'Open the jpg file
CavFormCapture.Open DOC_FOLDER & "\" & strFormName & "reports.JPG", ""
Set CpdFormCapture = CavFormCapture.GetPDDoc
'Insert the jpg at the right page
CpdCodeFile.InsertPages lngPage, CpdFormCapture, 0, 1, 0
If lngPage = 0 Then CpdCodeFile.MovePage 0, 2
MsgBox "Program has Run"
End Sub
In addition I forgot to mention I have used the tools- references-acrobat option.
I have read about the function CopyToClipboard(boundRect As Object, nXOrigin As Integer, nYOrigin As Integer, nZoom As Integer; however I do not know how to use it. With out an example to study I do not know how to reference it as an object much less use or reference the boundRect As Object, nXOrigin As Integer, nYOrigin As Integer, nZoom. Please can you give me some advice. Thank you so much for your time and consideration.
Sep 24 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.