Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using following code to print my data on the form through PrintForm.

VB
PrintDialog1.ShowDialog()
       PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
       PrintForm1.Print()


When I select printer and press Ok, it generates an error

VB
Path cannot be null. Parameter name: path


Please advise.

What I have tried:

Googled a lot!
Read forums, nothing worked for me.
Posted
Updated 28-Feb-17 23:20pm
Comments
Garth J Lancaster 1-Mar-17 5:08am    
dont forget we cant see your screen, so we cant see or know what PrintDialog1.PrinterSettings contains ... this link shows some usage of PrintDialog (you're right, good information is a bit thin on the ground) https://blogs.msdn.microsoft.com/vbteam/2007/07/12/using-the-printform-component-in-visual-basic-matt-gertz/

1 solution

A glance at the documentation[^] makes clear what is missing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900