Solved

pdf printing and providing filename

Posted on 2003-10-27
5
374 Views
Last Modified: 2010-05-01
Hello,

    I'm creating an application that needs the possiblity to generate PDF-files automatically without
    user interference.
    * Using "printing to the PDF-printer" doesn't allow my program to choose the new file/path so the user
       must deside every time.
    * Using the Acrobat Destiller works, but not for EXCEL files + I read somewhere that this is only for old
       versions of the Adobe PDF-writer.
    * I've allready tried some third-party software to, but nothing is sufficiant enough...

    can anyone help me with a link to a web-page or some example code on how to print to a pdf-file wich
    must be possible from Word/Excel (through automation) and must require NO user input.

thanx.
Bart
0
Comment
Question by:BartVergote
5 Comments
 
LVL 7

Expert Comment

by:_agj_
ID: 9625854
0
 
LVL 44

Accepted Solution

by:
bruintje earned 250 total points
ID: 9626154
title : print a PDF using the Acrobat Reader
source : http://www.planetpdf.com/mainpage.asp?WebPageID=90

description:
-----------
Option Explicit ' Force variable declaration
' Author : Karl De Abrew
' Company : A Round Table Solution
' Date : 30 November, 1998
' Description:
' This vb method uses the VB printer object and a command line call sourced from the Acrobat Developer FAQ to print a single PDF silently
' This method / function should be extended to suit the requirements
' of an organisation

Sub PrintAPDFUsingTheFreeAcrobatReader()

Dim strCommandLine As String
Dim strPrinterName As String
Dim strDriverName As String
Dim strPortName As String
Dim strFileNameToPrint As String

strFileNameToPrint = "c:\temp\filetoprint.pdf"

strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port

' Perform some error checking here
strCommandLine = "c:\acrobat3\reader\AcroRd32.exe /t """ + _
strFileNameToPrint + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """"

If (Shell(strCommandLine, vbHide) <> 0)Then
MsgBox "Job has been sent to the printer using the command " + strCommandLine
End If
End Sub
-----------

hope this helps a bit
0
 
LVL 8

Expert Comment

by:ampapa
ID: 9633131
Do you have the full version of Acrobat? or are you just using Distiller?
0
 
LVL 1

Author Comment

by:BartVergote
ID: 9633728
I Use a full version of Acrobat.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now