473,322 Members | 1,806 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,322 software developers and data experts.

Puzzled by PrinterName assignment

Hello.

Developing a VS.NET2003, VB Windows Form program.

When i execute the following code and stop it on the If statement, the
PrinterName is "Zebra TLP2844" and the IsValid is True.
If I comment out the first line and uncomment the second line and again
execute it stopping it on the If statement, the PrinterName is "Zebra
TLP2844", but the IsValid is False.

labelPrintDocument.PrinterSettings.PrinterName =
PrinterSettings.InstalledPrinters.Item(0).ToString
' labelPrintDocument.PrinterSettings.PrinterName = "Zebra
TLP2844"

If labelPrintDocument.PrinterSettings.IsValid Then
Dim y As String
y = labelPrintDocument.DocumentName
End If

I dont' get it. Why is it *not* a valid printer if i simply use a string?

Any help would be gratefully appreciated.

Thanks,
Tony
Dec 27 '06 #1
0 811

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Maciej Nadolski | last post by:
Hi! I`ve got a simple question but I`m puzzled:( When I create variable: for example $query for query to MySQL its obvieus that I want to use variables. Now should I do something like that: 1)...
23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
0
by: notregister | last post by:
i have been trying to send raw data using VB.NET directly to a printer ref: MSDN Article ID : 322090 In this article i can select the printername, but how do i know the printername is directly...
0
by: notregister | last post by:
Hi, How can i assign printername to an unknown printer?
35
by: nagy | last post by:
I do the following. First create lists x,y,z. Then add an element to x using the augumented assignment operator. This causes all the other lists to be changed also. But if I use the assignment...
1
by: Rich | last post by:
Hello, I need to print a report from the VS2005 Reportviewer control. My problem is that I need to print to a tractor feed (dotmatix like) printer that is not the default printer - for printing...
24
by: Tony Girgenti | last post by:
Hello. Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a windows XP Pro, SP2. Before printing a document, i want to set the font to a font that is only available...
20
by: TimeHorse | last post by:
I would like to gauge interest in the following proposal: Problem: Assignment statements cannot be used as expressions. Performing a list of mutually exclusive checks that require data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.