Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2008

Tip: Looking for answers? Try searching our database.

Acrobat Automation - Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
New2Access - 04 Jan 2008 09:32 GMT
Folks,

I am very new to using automation in VBA, but need to convert some .xls &
.doc files to pdf format using access (long story).

Anyway, through searching the web, I was able to hack together the code
below, which in the end seams to get me to where I need to be, but I have
the following 3 questions/problems (hoping someone can help).

#1 - After I run this, acrodist.exe & acrotray.exe still hang around as a
process in my task manager.  I can't see where I am not closing
something.  Anyone see why this still hangs up?

#2 - As the procedure runs, at different times, acrobat windows are
interacting (popping up) with the user (such as "Now Printing
Page....."), can I get it so these pop-ups never appears on the screen
and the user never gets a chance to cancel or close while procedure is
running?

#3 - Just looking for general comments on the code.  As I said, I
somewhat "hacked" this together using many different code samples and
resources from the web, but ultimately I want some people who work with
me to use this and I want it to be stable, so general feedback would be
appreciated.

======================================================
Public Sub CreatePDF()
On Error GoTo Proc_Error
   Dim objAcroApp As Acrobat.CAcroApp
   Dim objAVDoc As Acrobat.CAcroAVDoc
   Dim objAcroDoc As Acrobat.CAcroPDDoc
   Dim IsSuccess As Boolean
   
   Set objAcroApp = CreateObject("AcroExch.App")
   Set objAVDoc = CreateObject("AcroExch.AVDoc")
     
   IsSuccess = objAVDoc.Open("c:\Temp\blah2.doc", "")
   
   Set objAVDoc = objAcroApp.GetActiveDoc
   
   If objAVDoc.IsValid Then
       Set objAcroDoc = objAVDoc.GetPDDoc
                   
       If objAcroDoc.Save(1 Or 4 Or 32, "c:\Temp\work.pdf") <> True Then
           MsgBox "Failed to save"
       End If
       objAcroDoc.Close
   End If
   
   objAVDoc.Close True
   objAcroApp.Exit

Proc_Exit:
   Set objAcroDoc = Nothing
   Set objAVDoc = Nothing
   Set objAcroApp = Nothing
   
   MsgBox "Complete"
Exit Sub

Proc_Error:
   MsgBox Err.Description
Resume Proc_Exit
End Sub
============================================================

Thanks ahead of time.
mscertified - 04 Jan 2008 15:01 GMT
I think you need a PDF or Acrobat forum.

> Folks,
>
[quoted text clipped - 63 lines]
>
> Thanks ahead of time.
VT @ home - 05 Jan 2008 23:12 GMT
Il Fri, 04 Jan 2008 03:32:04 -0600, New2Access <nothing@hotmail.com> ha scritto:
>(.....)

>Folks,
>
[quoted text clipped - 4 lines]
>below, which in the end seams to get me to where I need to be, but I have
>the following 3 questions/problems (hoping someone can help).

Maybe you've already thought about what I'm going to say and discarded the solution.
Nevertheless I suggest you to use one of the freeware tools that install a virtual printer in the pc, which makes pdf
files from any application with printing capabilities.
Please see the following:
http://www.pdf995.com/
http://www.jawspdf.com/

HTH

Vincenzo Turturro

Certificato Eucip Core Level
ITA 0000-002299 del 14/05/2007
---------------------------------------------
il sito comune di it.comp.appl.access:
http://www.sitocomune.com
---------------------------------------------
risorse Access:
http://www.accessgroup.it
---------------------------------------------
Il sito comune di it.comp.as400
http://www.faq400.com
---------------------------------------------
Daniel Pineault - 06 Jan 2008 18:00 GMT
Personaly of you are looking for a pdf solution for MS Access you should take
a look at Leban's Report to PDF.

http://www.lebans.com/reporttopdf.htm

It is easy to setup and use and not complex!  Don't complicate your life for
no reason.
Signature

Hope this helps,

Daniel Pineault

> Folks,
>
[quoted text clipped - 63 lines]
>
> Thanks ahead of time.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.