 | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: VB Code to print to .pdf Hi Doug,
I feel like your new best friend (or that crazy person who asks too many
questions - you decide).
I actually have PrimoPDF on my computer already, and I love it - very easy
to use. I can select "Print" from the file menu and change the printer, but
I'd rather have a button on my form that allows users to print a copy of the
report directly to .pdf format (a shortcut). Currently my VB looks like:
Dim stDocName As String
Dim MyForm As Form
stDocName = "frmMVR"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Where in here can I set the printer type? I want it to select the printer Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
PrimoPDF.
--
Thank you! - Jennifer
"Douglas J. Steele" wrote:
> Take a look at what Stephen Lebans has at
> http://www.lebans.com/reporttopdf.htm Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>
> Other options include CutePDF at http://www.cutepdf.com, PDF995 at
> http://www.pdf995.com/ and the PDF and Mail Class Library from ACG Software
> at http://www.groupacg.com/
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Jennifer Cali" wrote in message
> news:039B7833-90A2-4272-A54D-D23B0EDA8D2F@microsoft.com...
> >I want to print the file to .pdf, but am not sure how to code the VB to do
> > it. Right now the print is going to the default printer; I need to change
> > the
> > printer that it prints to.
> > --
> > Thank you! - Jennifer
>
>
> | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: VB Code to print to .pdf Hi Jennifer,
You might find that one of these methods works for you. You may need to add
a command button to your form to print a report based on the active record in
your form, instead of the form itself.
Printer Selection Utility http://allenbrowne.com/AppPrintMgt.html
How to automate the process of selecting the printer
for a report in Microsoft Access http://support.microsoft.com/?id=319317
Programming Printer Settings in Microsoft Access 2002 http://msdn.microsoft.com/library/de...0_printers.asp
Tom Wickerath
Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.html
__________________________________________
"Jennifer Cali" wrote:
> Hi Doug,
> I feel like your new best friend (or that crazy person who asks too many
> questions - you decide).
>
> I actually have PrimoPDF on my computer already, and I love it - very easy
> to use. I can select "Print" from the file menu and change the printer, but
> I'd rather have a button on my form that allows users to print a copy of the
> report directly to .pdf format (a shortcut). Currently my VB looks like: Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>
> Dim stDocName As String
> Dim MyForm As Form
>
> stDocName = "frmMVR"
> Set MyForm = Screen.ActiveForm
> DoCmd.SelectObject acForm, stDocName, True
> DoCmd.PrintOut
> DoCmd.SelectObject acForm, MyForm.Name, False
>
> Where in here can I set the printer type? I want it to select the printer
> PrimoPDF.
> --
> Thank you! - Jennifer
>
>
> "Douglas J. Steele" wrote:
>
> > Take a look at what Stephen Lebans has at
> > http://www.lebans.com/reporttopdf.htm
> >
> > Other options include CutePDF at http://www.cutepdf.com, PDF995 at
> > http://www.pdf995.com/ and the PDF and Mail Class Library from ACG Software
> > at http://www.groupacg.com/
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
> > (no private e-mails, please)
> >
> >
> > "Jennifer Cali" wrote in message
> > news:039B7833-90A2-4272-A54D-D23B0EDA8D2F@microsoft.com...
> > >I want to print the file to .pdf, but am not sure how to code the VB to do
> > > it. Right now the print is going to the default printer; I need to change
> > > the
> > > printer that it prints to.
> > > --
> > > Thank you! - Jennifer
> >
> >
> > | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: VB Code to print to .pdf Jennifer,
An alternative approach is to open the report in design view, go to the Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
File|Page Setup menu, on the 'Page' tab select the 'Use specific
printer' option, and then enter your PrimoPDF in there. I think that's
how I would do it.
--
Steve Schapel, Microsoft Access MVP
Tom Wickerath wrote:
> Hi Jennifer, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>
> You might find that one of these methods works for you. You may need to add
> a command button to your form to print a report based on the active record in
> your form, instead of the form itself. | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: VB Code to print to .pdf Jennifer, the below code works for me. You don't have to mess around with
changing the default printer and then changing it back again. The code
changes the target printer for this report this time. Works for any report, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
any printer (Not tested for networked printers). Access 2003.
HTH, UpRider
DoCmd.OpenReport "YourReportName", acViewPreview
Application.Reports("YourReportName").Printer =
Application.Printers("YourPDFPrinter")
"Jennifer Cali" wrote in message
news:039B7833-90A2-4272-A54D-D23B0EDA8D2F@microsoft.com...
>I want to print the file to .pdf, but am not sure how to code the VB to do
> it. Right now the print is going to the default printer; I need to change
> the
> printer that it prints to.
> --
> Thank you! - Jennifer | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: VB Code to print to .pdf Would the name of the printer be the name I see when I select the dropdown or
is there another "name" that is recoginized by the computer?
--
Thank you! - Jennifer
"UpRider" wrote:
> Jennifer, the below code works for me. You don't have to mess around with
> changing the default printer and then changing it back again. The code
> changes the target printer for this report this time. Works for any report,
> any printer (Not tested for networked printers). Access 2003.
> HTH, UpRider
>
> DoCmd.OpenReport "YourReportName", acViewPreview
> Application.Reports("YourReportName").Printer =
> Application.Printers("YourPDFPrinter") Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>
> "Jennifer Cali" wrote in message Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
> news:039B7833-90A2-4272-A54D-D23B0EDA8D2F@microsoft.com...
> >I want to print the file to .pdf, but am not sure how to code the VB to do
> > it. Right now the print is going to the default printer; I need to change
> > the
> > printer that it prints to.
> > --
> > Thank you! - Jennifer
>
>
> | 
28-Jul-2006, 08:37 AM
|  | Guest | | | | | | | | | | Re: VB Code to print to .pdf Yes, it's the printer name that you see in the Windows print dialog
dropdowns...
UpRider
"Jennifer Cali" wrote in message
news:AE53F29A-5645-412C-9E62-81AD6422390D@microsoft.com...
> Would the name of the printer be the name I see when I select the dropdown
> or
> is there another "name" that is recoginized by the computer?
> --
> Thank you! - Jennifer
>
>
> "UpRider" wrote:
>
>> Jennifer, the below code works for me. You don't have to mess around
>> with
>> changing the default printer and then changing it back again. The code
>> changes the target printer for this report this time. Works for any Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>> report,
>> any printer (Not tested for networked printers). Access 2003.
>> HTH, UpRider Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>>
>> DoCmd.OpenReport "YourReportName", acViewPreview
>> Application.Reports("YourReportName").Printer =
>> Application.Printers("YourPDFPrinter")
>>
>> "Jennifer Cali" wrote in message
>> news:039B7833-90A2-4272-A54D-D23B0EDA8D2F@microsoft.com...
>> >I want to print the file to .pdf, but am not sure how to code the VB to
>> >do
>> > it. Right now the print is going to the default printer; I need to
>> > change
>> > the
>> > printer that it prints to.
>> > --
>> > Thank you! - Jennifer
>>
>>
>> | 
28-Jul-2006, 08:37 AM
|  | Guest | | | | | | | | | | Re: VB Code to print to .pdf It should be the same
Pieter
"Jennifer Cali" wrote in message
news:AE53F29A-5645-412C-9E62-81AD6422390D@microsoft.com...
> Would the name of the printer be the name I see when I select the dropdown
> or
> is there another "name" that is recoginized by the computer?
> --
> Thank you! - Jennifer
>
>
> "UpRider" wrote:
>
>> Jennifer, the below code works for me. You don't have to mess around
>> with
>> changing the default printer and then changing it back again. The code
>> changes the target printer for this report this time. Works for any
>> report,
>> any printer (Not tested for networked printers). Access 2003.
>> HTH, UpRider
>>
>> DoCmd.OpenReport "YourReportName", acViewPreview
>> Application.Reports("YourReportName").Printer =
>> Application.Printers("YourPDFPrinter") Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>>
>> "Jennifer Cali" wrote in message Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13344
>> news:039B7833-90A2-4272-A54D-D23B0EDA8D2F@microsoft.com...
>> >I want to print the file to .pdf, but am not sure how to code the VB to
>> >do
>> > it. Right now the print is going to the default printer; I need to
>> > change
>> > the
>> > printer that it prints to.
>> > --
>> > Thank you! - Jennifer
>>
>>
>>
--
----------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 4231 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Active Discussions | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | » Books You Should Read... | | | |