473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

All I want to do is print a string!

I think this is a really dumb question! All I want to do is print a string! I’ve looked up loads of web pages and they all tell me that

Print “string”

Or

Printer.print “String” should work

Neither do.

Print “String” reports the error ‘Method not valid without a valid object’

And

Printer.Print “String” reports ‘Object required’

What am I missing!
Apr 18 '11 #1
2 1884
Guido Geurs
767 Expert 512MB
This works for me: it sends the text to the default printer (a CutePDF file printer = sends a PDF file to the HD).

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.    Printer.Print "0123456789"
  3.    Printer.EndDoc
  4. End Sub
Do you have a default printer defined?
I have test it with CutePDF printer and a PDF file is saved.
Maybe you can test it also first by setting a file-printer (or an other printer)
as default.
If this is working than the code is OK but the connection to the real printer not OK?
I have also seen that only after the line "Printer.EndDoc
", the document is created!
Maybe your printer is waiting for an end-key ?
Apr 19 '11 #2
Thanks

This just confirms me thoughts that I have something wrong with my set up as this doesn't work. At run time I get 'error 424 Object required'.
Apr 21 '11 #3

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

Similar topics

2
by: Balaji | last post by:
Hello Eveybody, I have written a method which prints the prefix notation of any expression. here is the method... def PrintPrefix(expr): if expr.__class__==E: print expr.operator,...
5
by: occam | last post by:
I form an 'html' string interactively that can be output by `xx.html` as 'document.write(string)' which shows the html and the html source. I can also see the string using `alert("string...
6
by: Protoman | last post by:
I'm trying to print a string, and cout isn't printing it; here's my code: #include <iostream> #include <cstdlib> #include <string> #include <cctype> using namespace std; namespace
2
by: Jeremy Clulow | last post by:
Hi, I've designed a site at http://www.welsh-kitchens.com When all styles are disabled it looks like this http://www.welsh-kitchens.com/index-nocss.shtml I've tried creating a printing...
3
by: applegreenss | last post by:
I am looking for a javascript function ( don't know what they call ths ) which will print a line of text, one letter at a time at a certain speed until the full string is printed. Can this be done...
2
by: Peted | last post by:
Hi im sending this string to a device String cmd = ""N1\x0D") this device needs the esc \x0D on the end where you see it After i have sent this string i want to print it our to a rich...
38
by: ssecorp | last post by:
char* reverse(char* str) { int length = strlen(str); char* acc; int i; for (i=0; i<=length-1; i++){ acc = str; } return acc; }
0
by: ghjk | last post by:
I'm using jsp. I want to print string array values . How can I do that? please help me. This is my code. ArrayList settings = (ArrayList)session.getAttribute("settingList");
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.