Results 1 to 14 of 14

Thread: [RESOLVED] Print .pdf from VB6

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Resolved [RESOLVED] Print .pdf from VB6

    My goal is to print a single .pdf file on my desktop from VB6.

    Can anyone help me do this?

    Thank you.

    Chris

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Print .pdf from VB6

    You can use a third part pdf print driver so its nothing more then printing to that "printer". Or you can also google for many of the third party utilities for this too.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Print .pdf from VB6

    Thanks Rob...

    I had googled it prior. Found some stuff but nothing too helpful. I will continue to search!

    Thanks.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Print .pdf from VB6

    I had found this:

    http://www.vb-helper.com/howto_print_pdf.html

    However the code is not compatible with Adobe Reader 7.0!

    Any help would be appreciated.

    Thanks!

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Print .pdf from VB6

    Yea, thats using DDE so its application version specific.

    Try pdf995.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Print .pdf from VB6

    Oh, I see. Wasn't sure obviously what DDE was.

    I hope I was clear too on my initial goal... when I say "print" I mean to send the pdf file to my default printer.

    Thanks.

    I did download pdf995...

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Print .pdf from VB6

    There is always the ShellExecute API that can be used for printing.

  8. #8
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: Print .pdf from VB6

    Quote Originally Posted by Hack
    There is always the ShellExecute API that can be used for printing.
    http://support.microsoft.com/kb/238245 --> Here is the link for shellexecute API.

    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Print .pdf from VB6

    Thanks!

    Seems to be working smoothly.

  10. #10
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: Print .pdf from VB6

    Quote Originally Posted by chris.cavage
    Thanks!

    Seems to be working smoothly.
    Could you please post your code? I get the Adobe Reader splash screen getting displayed when I use it.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: [RESOLVED] Print .pdf from VB6

    ShellExecute 0&, "Print", "C:\yourfilepath.pdf", "", "", vbNormalFocus

    I am getting that screen too...

    Instead I used the printout property for the excel sheet I was saving as pdf.

    I couldn't figure out how to silently print the .pdf

  12. #12
    New Member
    Join Date
    Aug 2010
    Posts
    11

    Re: [RESOLVED] Print .pdf from VB6

    This doesn't seem to work for me. But my pdf file is stored in an internet location and so the filename starts with "http://........xxx.pdf"
    The document opens if the code verb is "open" but when I do "print", nothing happens. Any help would be appreciated. thanks,

  13. #13
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: [RESOLVED] Print .pdf from VB6

    Is it possible for you to download that file to a local folder, before printing it?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  14. #14
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: [RESOLVED] Print .pdf from VB6

    This thread is 2 years old and started by another memeber. It is general policy to start new threads for your questions, rather than reviving old ones, especially if they were not started by yourself. If your question is similar or has something to do with another thread, like you have here, then just post a link to that thread in your own.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width