Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to jump Cute pdf writer dialog print box with VBA.

Posted on 2008-06-21
9
4,574 Views
Last Modified: 2012-06-27
Hi I am actually trying to add a step in a MS Access-Word mail merge, that allows me to create the equivalent file in .pdf
Unfortunately I cannot manage to avoid tiping ENTER at each time the document goes to print.
I have tried SenKeys method, but with no result.
I was thinking to something like:
Dim PrintDialogBox as application
PrintDialogBox.visible=false
With PrintDialogBox
SendKeys ENTER
End WIth
to repeat after each printing steps.
Can you suggest please? Thanx.
0
Comment
Question by:Sar1973
  • 5
  • 4
9 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 21838138
Use the PrintOut Method

   Dim wdApp as Word.Application
   '...
    wdApp.ActivePrinter = "CutePDF Writer"
    wdApp.ActiveDocument.PrintOut OutPutFileName:="MyFile.pdf"

Open in new window

0
 
LVL 9

Author Comment

by:Sar1973
ID: 21838744
Now it works, since it does not ask to Save the file with the dialog box, but it creates a huge .pdf file that cannot be opened by Adobe since appears to be corrupted.
I think that it depends on my freeware version of Cute; if you know a cheap pdf writer that:
1) can be configurated as a virtual printer
2) works with your code
3) (eventually) is useful also to convert .pdf to .jpg
you're welcome.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 21838834
I have never created a pdf file. I just know how to programme printing to a file and understand that most pdf creators work like that. I downloaded PDF995 in case I needed it to answer your previous question, but I haven't had time to try it. It has been recommended several times in postings in the Word. The site claims that it can convert to pdf to jpeg

http://www.pdf995.com/
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 9

Author Comment

by:Sar1973
ID: 21841914
Very nice: it performs SendKeys command, but I have no idea on:
1) making invisible the dialog box (I cannot actually perform in creating the application)
2) use the wdApp.ActiveDocument.PrintOut OutPutFileName method: I get as well a corrupted file and I'm not sure that it depends on the freeware.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 21844214
1. Which dialog box?
2. Does creating the pdf from the document work if you do it manually?
0
 
LVL 9

Author Comment

by:Sar1973
ID: 21844576
When you launch a print with pdf995 (but also with others such as Cute) a print dialog box appeaars asking you to confirm file name and path. If I use the SendKeys method there is no problem, but I 'd prefer to:
1)identify that dialog box
2)give a command line that allows my routine to jump to that dialog box
3)use the sendkeys method
Can you post some code for that? Thanx.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 21844928
I have now created a PDF file (my first) using pdf995 . It seems to act differently from the Adobe writer which I think can use the PrintOut method to a file. Perhaps that is why pdf995 is free.

I don't use Sendkeys. You may have to use the FindWindow API to get the handle of the dialogue.
0
 
LVL 9

Author Comment

by:Sar1973
ID: 21845205
I don't have any function like that in my MS Access 2000 library.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 75 total points
ID: 21845247
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Export PDF Form fields to Access  or Excel  in Tab order 16 80
Dinamic report to Crosstab query 9 33
checkbox to hide entire section 10 42
Set WorkSheet  not Working 9 41
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

860 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