• Top Members
    Reps
    Posts
  • 834 Replies
    2585 Replies
  • 716 Replies
    2025 Replies
  • 331 Replies
    1928 Replies

Somepages

Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
User avatar
Dummy1912
VIP - Donator
Posts: 1967

Somepages

Sun Jul 29, 2018 9:46 am

Hello,

can someone help me
with our print range?

it seems we can't use the frompage and topage
to print the pages we want

search on the net for hours found some examples
but its not working....

anyone?

Code: Select all


        PrintDocument1.PrinterSettings.FromPage = 2
        PrintDocument1.PrinterSettings.ToPage = 2
        PrintDocument1PrinterSettings.PrintRange = PrintRange.SomePages

even we added on the beginprint

Code: Select all

If (CType((sender), System.Drawing.Printing.PrintDocument)).PrinterSettings.FromPage = 0 AndAlso (CType((sender), System.Drawing.Printing.PrintDocument)).PrinterSettings.ToPage = 0 Then
            PrintDocument1.PrinterSettings.FromPage = Integer.Parse(pageNum)
            PrintDocument1.PrinterSettings.ToPage = Integer.Parse(totalPages)
            PrintDocument1.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages
        End If
please...

Thank you


User avatar
CodenStuff
Site Admin
Posts: 4375

Re: Somepages

Sat Aug 11, 2018 6:39 pm

Sorry Dummy1912 I don't have much experience using printer controls, never had the need for them myself lol

Try adding this to your code before or after you set topage/frompage

Code: Select all

PrintDocument1.AllowSomePages = True
OR

Code: Select all

PrintDocument1.AllowSelection = True
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.

User avatar
Dummy1912
VIP - Donator
Posts: 1967

Re: Somepages

Sun Aug 12, 2018 6:01 am

Hi,

Thanks for the tryout but didn't work :(

Post Reply

Return to “Coding Help & Support”