Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

VB Code to print to .pdf

Discussion in 'Information Technology' started by Jennifer Cali, Jul 28, 2006.

Tags:
  1. Jennifer Cali

    Jennifer Cali
    Expand Collapse
    Guest

    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
     
  2. Loading...

    Similar Threads Forum Date
    Introducing The Spn Code Of Forum Etiquette Announcements Feb 20, 2016
    UK Sikh 'code of silence' on sexual grooming Breaking News Sep 2, 2013
    Can a Dress Code Bar Ethnic and Religious Attire Based on Customer Preferences in the US? Questions and Answers May 3, 2011
    Pacific Code Exempts Religious Drivers (Fiji) Breaking News Feb 16, 2011
    Controversial Gurdwaras 'Breaking the Sikh Code' on Meat and Alcohol Hard Talk Dec 2, 2010

  3. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    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
    (no private e-mails, please)


    "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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
     
  4. Jennifer Cali

    Jennifer Cali
    Expand Collapse
    Guest

    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
    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
    > (no private e-mails, please)
    >
    >
    > "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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

    >
    >
    >
     
  5. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    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/d...ry/en-us/dnacc2k2/html/odc_acc10_printers.asp


    Tom Wickerath
    Microsoft Access MVP

    http://www.access.qbuilt.com/html/expert_contributors.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:
    >
    > 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
    > > (no private e-mails, please)
    > >
    > >
    > > "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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

    > >
    > >
    > >
     
  6. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Jennifer,

    An alternative approach is to open the report in design view, go to the
    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,
    >
    > 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.
     
  7. UpRider

    UpRider
    Expand Collapse
    Guest

    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")

    "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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
     
  8. Jennifer Cali

    Jennifer Cali
    Expand Collapse
    Guest

    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")
    >
    > "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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

    >
    >
    >
     
  9. UpRider

    UpRider
    Expand Collapse
    Guest

    Yes, it's the printer name that you see in the Windows print dialog
    dropdowns...

    UpRider

    "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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")
    >>
    >> "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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

    >>
    >>
    >>
     
  10. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    It should be the same

    Pieter

    "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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")
    >>
    >> "Jennifer Cali" <JenniferCali@discussions.microsoft.com> 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

    >>
    >>
    >>




    --
    ----------------------------------------
    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
     

Share This Page