Programming
--
Questions
--
Followers
Top Experts
I want to open an existing PDF file using OLE automation.
I have built a project which allows the user to open Word and Excel templates.
I am using the following code to open Word/Excel:
Dim wordApp as Word.Application
Dim wordDoc as Word.Document
wordApp = New Word.Application
wordApp.Visible = True
wordDoc = wordApp.Documents.Add
I would ideally like the reference needed as well as the code to access the pdf file.
Thanks
Gareth
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Try searching for an open source component that edits files - may find one out there.
If you are trying to open the pdf file Fron your app with Acrobat Reader then use
ShellExecute(hwnd, "Open", "filename.pdf", 0&, 0&, SW_SHOW)
try 5 istead
Gareth can you please give more exact specs abt why you need a word document to open a PDF file. Infact, if you need to extract text or image from pdf there is free source code available on the next.
The source code for one of the tools is available at
http://www.verypdf.com/pdf2htm/index.html
it inturn depends on XPDF library obtained at following url
http://www.foolabs.com/xpdf/download.html
Best of luck!






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Shell ("C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe")
Now, does anyone know the switch to open a pdf file.
For example, when you shell a word template the switch is \t (then the path of the template)
I want to put in a switch to open an existing file any ideas?
Many thanks
After you are using the shell routine just use:
shell ("start " +<file paht and name>,,,,,);
The string filename.pdf must include
The default app for the file is autostarted

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
http://www.code101.com/Code101/DisplayArticle.aspx?cid=69
i hope it'll be of any help
That doesn't seem to work. I am using the following code.
("start""C:\Documents and Settings\J Smith\Publications\FileNam
Is there a reference I need to use?






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
"start C:\Documents and Settings\J Smith\Publications\FileNam
"start " + "C:\Documents and Settings\J Smith\Publications\FileNam
Sorted by using the following:
Shell ("Full File Path to Adobe Executable File & Full File Path to PDF File")
needs to be included to do
start(FiletoOpen)
This will open the file with the associated app.
Just incase the shell one dosn't always work.
Thanks and GL

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
This is part of my code that I use to merge .PDF files.
Dim AcroApp As Acrobat.CAcroApp
Dim PDDoc As Acrobat.CAcroPDDoc
Dim InsertPDDoc As Acrobat.CAcroPDDoc
Dim iNumberOfPagesToInsert As Integer, iLastPage As Integer
Dim goRound As Integer, strOutput As String, strTest As String
On Error GoTo ErrorHandler
AcroApp = CreateObject("AcroExch.App
PDDoc = CreateObject("AcroExch.PDD
InsertPDDoc = CreateObject("AcroExch.PDD
Hope this helps.
Programming
--
Questions
--
Followers
Top Experts
Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.