By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,955 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,955 IT Pros & Developers. It's quick & easy.

Print on Form

P: 89
Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
Dim MyVar
MyVar = "Hello."
Debug.Print MyVar

but it doesnt work? could u pls tell my how i can just put a line on form on left top corner? Thx a lot
Jan 4 '08 #1
Share this Question
Share on Google+
4 Replies


debasisdas
Expert 5K+
P: 8,127
just use

Print myvar
Jan 4 '08 #2

P: 89
just use

Print myvar


Hi, I used this but its say " Object doesnt support this property or method
Jan 4 '08 #3

debasisdas
Expert 5K+
P: 8,127
are you using vb 6.0 ?
Jan 4 '08 #4

Expert 5K+
P: 8,434
You have to use the appropriate method (in VB6, generally the Print method) of a particular object. For example to print on Form1, you would use Form1.Print or to print on the actual printer, use Printer.Print.

When you use Debug.Print, it prints to the "immediate window". That is the window where VB shows any debugging info. This is only available in the IDE, not at runtime.
Jan 4 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.