?
Solved

Access 2007 accdb Adobe PDF apiFindExecutable

Posted on 2009-04-28
13
Medium Priority
?
803 Views
Last Modified: 2012-05-06
Hi Experts

I have converted a mdb to a accdb and it works great. But i have one problem. I have added to functions. in the code field. "Find_Exe_Name" is the one that gives me problems in the line:

Return_Code = apiFindExecutable(prmFile, prmDir, Return_Value)

If the database is a mdb i get the code : 42

But after i converted i get: 31

If the database is a mdb "Return_Value" becomes something like this:
C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE + and a lot of spaces

But with the accdb i only get the spaces.

The function is used for setting up some PDF printing settings, so it does not promt the user for a destination.
Public Function Find_Exe_Name(prmFile As String, prmDir As String) As String
 
Dim Return_Code As Long
Dim Return_Value As String
 
Return_Value = Space(260)
 
Return_Code = apiFindExecutable(prmFile, prmDir, Return_Value)
 
If Return_Code > 32 Then
    Find_Exe_Name = Return_Value
Else
    Find_Exe_Name = "Error: File Not Found"
End If
 
End Function
 
Public Declare Function apiFindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long

Open in new window

0
Comment
Question by:DCRAPACCESS
  • 7
  • 6
13 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24251049
the pdf module is a separate add-in for Access 2007, see this link:

                      http://www.microsoft.com/downloads/details.aspx?FamilyID=4d951911-3e7e-4ae6-b059-a2e79ed87041&displaylang=en
0
 

Author Comment

by:DCRAPACCESS
ID: 24251816
I have adobe 7 pro and that is what i'm using and i'm sorry to say, but I can't use the add-in in office 2007.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24252332
<<<<< I can't use the add-in in office 2007>>>>
Not sure what you mean.  Please clarify.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:DCRAPACCESS
ID: 24253255
I merge files with adobe through vba code, i'm not sure that the add-in can that in office 2003?
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24254148
The add-in is MS's adobe emulator; it works natively with MS Office 2007 programs.  You don't need adobe.

See my answers at this link for details on this method and the shell method.

            http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_23480129.html
0
 

Author Comment

by:DCRAPACCESS
ID: 24257722
Can you please provide me with a code example that shows how to take two pdf files from one location e.g "c:\Temp\" and merge them into one?
Else i can't use the add-in.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24259103
From everything I can find out, there is no code because that functionality is buil-in as plug and play if you have Access (MS Office) 2007 and Adobe Writer Version 7.  See the links below:

http://www.ehow.com/how_2087355_create-adobe-pdf-file-from.html

http://www.lockergnome.com/it/2006/04/10/how-to-export-a-microsoft-access-report-as-a-pdf/
 excerpt:
 I was recently working with Adobe Acrobat Writer Version 7 and I found that this version of the software now installs itself in all major Microsoft Office applications. This is a fantastic step forward for Microsoft Access developers as this means you can develop a report exclusively in Microsoft Access and then print the report straight to a PDF format rather than first going to a Microsoft Word document then converting it into an Adobe Acrobat PDF file.
 
Adobe has provided two ways to generate your PDF report. First off, it installs an Adobe dropdown menu into the Microsoft Access main menu bar and from this dropdown menu you can then choose to create the report as an Adobe PDF. Note: You must open the report first. You can even use this menu function to create the report and then email it directly to a third party.

The second method is to open your report and then choose the File menu and then Print. The Print dialog box will open and then you choose Adobe Acrobat writer as the printer and then choose the OK button, which will then start Adobe Acrobat and generate your PDF
0
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 1500 total points
ID: 24259352
Found this tutorial, which may be helpful to you:
            http://www.megaleecher.net/Download_Microsoft_Office_Save_As_PDF_Addin_For_Converting_Office_Files_To_PDF
0
 

Author Comment

by:DCRAPACCESS
ID: 24480490
Sorry for not getting back on this question, but it seems that i can not do what i want with the add-in. I need to merge PDF files, and that is not a thing the add-in supports or Access 2007 in general.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24482263
Accordng to this link, you can merge pdfs via Adobe using the >>>Combine Multiple<<<  command.
                      http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=141 
0
 

Author Comment

by:DCRAPACCESS
ID: 24482583
Yes Adobe can, so I have to stick with that until MS comes with a solution that can merge PDF files.
0
 

Author Comment

by:DCRAPACCESS
ID: 24482596
You can have the points for your effort. Have a nice day!
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24482699
I believe there are inexpensive 3rd party tools that will enable you to merge pdf via ms access, if you are interested.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

807 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