[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to print webpage using PrimoPDF (or alternative freeware PDF generator) in VBA

Posted on 2008-11-11
10
Medium Priority
?
946 Views
Last Modified: 2012-05-05
Hi,

I am trying to print a webpage to a PDF file using PrimoPDF. I am happy to look at another program if you have a solution for that. I'm not using Acrobat as users may not have this. In addition users are unlikely to have Office 2007 so need a third party solution.

So far I am happy printing the website itself. Code to do that would be

Sub PrintWebsite(webAddress As String)
    Dim IE As Object, objDoc As Object
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate webAddress
    IE.ExecWB 6, 2, 2, 0
    Set objDoc = Nothing
    Set IE = Nothing
End Sub

I also haven't had much success in setting the print to being PrimoPDF. I have tried
    Set Application.Printer = Application.Printers("PrimoPDF")   - error: Object doesn't support this property or method
and Application.ActivePrinter = "PrimoPDF" produces an error too

So how can I set the printer to be PrimoPDF and manipulate the Printer dialogue box so that I can pass it a string with where to print the file? In addition there are various standards of quality available such as "Screen", "Print", "ebook" etc. Now I am happy with Print but since I am asking the question I might as well ask if anyone knows how to select one of these so I can choose. I'm assuming I'm probably going to have to resort to some kind of Send keys method.


Thanks in advance for your help,

Neil.
0
Comment
Question by:mightyginger
  • 5
  • 4
10 Comments
 
LVL 13

Expert Comment

by:game-master
ID: 22936111


are u using vb.net  or vb6 to do it programmatically?

game-master
0
 

Author Comment

by:mightyginger
ID: 22936167
I am actually running this as part of a larger macro which is being run in visual basic for applications, within a copy of Excel. Sorry if that wasn't clear, couldn't find a VBA specific forum.
0
 
LVL 13

Expert Comment

by:game-master
ID: 22936518


make sure u have installed the "PrimoPDF" in your computer..

can u give me your email address so I can send a concrete example to you.

game-master
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:mightyginger
ID: 22938228
Primo is definately installed. E-mail gingerthistle@gmail.com - thank you.
0
 
LVL 13

Expert Comment

by:game-master
ID: 22945764

good morning!

i have sent the program to you..
but on that example, i used "PDFCreator" as my pdf writer because i dont
have "PrimoPDF" software.

Dont forget to add on the references the PrimoPDF.

Note:Replace the "PDFCreator" with "PrimoPDF". But if you dont want,
u can download the "PDFCreator" that i used then the program will run smoothly..


game-master
0
 

Author Comment

by:mightyginger
ID: 22946265
I am using visual basic for applications and not vb6. Do you have a solution using VBA code?
0
 

Author Comment

by:mightyginger
ID: 22956826
Can anyone else help?
0
 

Accepted Solution

by:
mightyginger earned 0 total points
ID: 22972718
I have resolved this myself. Thanks.
0
 
LVL 13

Expert Comment

by:game-master
ID: 22972822


good morning!

i am very sorry for the late reply..
i was out on the office and i just came back..

im glad u have solved your problems...


game-master
0
 

Expert Comment

by:Marceloroyo
ID: 26850662
Sorry, but what's the point of this site if you don't publish the solution...
0

Featured Post

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.

Question has a verified solution.

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

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

834 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