Rea Software Engineering
Hi,
The error is stating that the object you are trying to use does not have a name. In you instance the object is "formImage". I am guessing you are programmatically creating the "formImage" object and whatever it contains.
Since you didn't provide any of the coding on how the "formImage" object is instantiated I can't provide a direct coding resolution.
At this moment I would suggest adding a line of code that names your "formImage" object. An example would be something like: formImage.Name = "myImage". Your complete coding may look something like this:
Code Snippet
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles myDocument.PrintPage
formImage.Name = "Test"
e.Graphics.DrawImage(formImage, 200, 300)
End Sub
This would work if you are declaring the "formImage" as an object that supports the "name" property. If you want a more clear response, please post the complete coding you are using to create the "formImage" and any other coding you are using to initialize the "myDocument.print" method.
I hope the above example helps...if not then I am sure we can get it solved if further coding is posted.
Thanks,
James