How To Check The Printer On The Network Before Printer.print Method?
Hi, I am trying to write code to be able to give user option to choose a printer on the network before they can printer the job.
With printer.print method, VB will not prompt the printer on the network. It will only print to the default printer.
Is there a way to be able to choose the printer?
Thanks!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Print Urdu Unicode Characters Using Printer.print Method ...??
Ive written a code for accepting input in text boxes in urd language and store it in access database and similarly i ca retrieve it back from the database and show it in the text boxe from the database in urdu language in vb6.0. But i cannot prin the same urdu unicode characters from the text boxes using th Printer.Print method, and if i do so i got ??????? (questio marks) printed instead of the urdu unicode characters. I eve tried the rich text boxe's selPrint method also but that als print the same ?????.
i wan to print the contents of the text boxes i.e unicod characters in urdu language.
Can anyone tell me how to do this as soon as possible ........??
Can anyone share with me the code for doing the above printing o unicode characters?
Waitin for the reply as earliest .......!!!
How To Print Urdu Unicode Characters Using Printer.print Method ...??
Ive written a code for accepting input in text boxes in urdu language and store it in access database and similarly i can retrieve it back from the database and show it in the text boxes from the database in urdu language in vb6.0. But i cannot print the same urdu unicode characters from the text boxes using the Printer.Print method, and if i do so i got ??????? (question marks) printed instead of the urdu unicode characters. I even tried the rich text boxe's selPrint method also but that also print the same ?????.
i wan to print the contents of the text boxes i.e unicode characters in urdu language.
Can anyone tell me how to do this as soon as possible ........??
Can anyone share with me the code for doing the above printing of unicode characters?
Waitin for the reply as earliest .......!!!
Printer.Print Method
Hi Guys,
I have this problem with the printer object.
hwen VB6 tries to execute this command
Printer.Print Variable1
It gives me an error
Method or Data Member Not found
and in nowhere in the properties and methods of teh printer object is print method found, not even on microsfots MSDN library
But MSDN suggests use of Print method to print documents
Where am I wrong??? If somebody can please helpme
Plz Help Me On Printer.print Method
--help me--help me--help me--help me--help me--help me--help me--help me--
In vb6 how can i print a visual basic form using printer.print method or How i can print a vb form using printing dialog box.
I try printform & printing dialog box but when i choose the printer the printer only set as a default printer. But the change of the printer not effect on printing. if i set the printer ink is low quality but that is not effect on the printing the printer print default settings. Plz send me a sample code how the user printing setting will work on printing visual basic form. Plz Help me.......
--help me--help me--help me--help me--help me--help me--help me--help me--
Plz Help Me On Printer.print Method
--help me--help me--help me--help me--help me--help me--help me--help me--
how can i print a visual basic form using printer.print method or How i can print a vb form using printing dialog box Plz Help me..
--help me--help me--help me--help me--help me--help me--help me--help me--
Printer.print Method Missing...
I'm missing tons of stuff from my VB6 app it seems. I just recovered my Common Dialog control thanks to this forum, now when I summon up Printer, the .Print method does not show up! This hasn't happened to me before.
Is there something I need to load? All the other Printer methods and properties seem to be there.
Thanks!
Ed
Why Isn't The Printer.Print Method Documented In VB6?
Anybody know? It seems to be the only way to print text directly to the printer, yet Printer.Print isn't included in the Printer context menu, it's not in the Object Browser, it's not listed as a valid method, nor is the Printer object in the Applies To list for the Print method. Is there another way you're supposed to print text? Anyone have any insight here?
Thanks,
-JoeyCode
Print Method Of Printer Object
This program are looking after pdf files in a directory. If a pdf file exists, it will find the size in strFormat (A4 or A3). By some other functions if finds the printer device name in strPrinterName.
So the problem is that I have to change the paper size, depending on the size found in strFormat. Look in the example.
This program is runing on a server, so there is no dialog...
Ex.
For i = 0 To Printers.Count - 1
If cSetPrinter.SetPrinterAsDefault(strPrinterName) Then
' This sets the printer as default
If strFormat = "A4" Or strFormat = "a4" Then
Printer.PaperSize = 9
Else
Printer.PaperSize = 8
End If
End if
Next
' Print out the PDF File
r = AcroExchAVDoc.printPages(0, (nMaxPage - 1), 1, 0, 1)
If I go to the Printer Settings and set the Paper size = "Letter Small, ..." ( = 2 !) and If I put the printer on pause..., and execute the program, the document in the printer queue will have the paper size = 2.
Please help...
How To Print To Network Printer
I am trying to print a text string to a Zebra label printer with a network card. The program I am changing originally printed to the local printer port - LPT1. The only thing I have tried that has actually worked is to write the output to a text file, then "type" the file to the network printer like this:
type S400.txt > \networkprinterThis works but it is a kludge - I'm sure that there is a way to do it, I just haven't been able to figure it out.
I have tried:opening the actual network numeric addressopening the network share nameusing the printer objectThe only thing that has come close to working is using the RichTextBox to print it; however, it not only printed the label it also printed the text that creates the label on top of it.
Any help with this would be greatly appreciated.
Print To Network Printer
I need to print to a networked label printer - it has a network adapter connected to the parallel port with it's own IP address. Can I print to it using the IP address? If not, how?
Thanks.
Print To Network Printer Vb
I can print using vb to my local lpt1, using the code below.
My problem is that now i need to print to a network printer - i need to specify printer name instead of the lpt1.
How can i do this?
VB Code:
Open "lpt1" For Output As #1 For i = 1 To txtPrintNo Print #1, strText Next i
How To Print Using Network Printer In VB
Can anybody tell me how to print using network printer in vb. You can find the print in network but it is not in the printers list on your computer. So I can't find the computer in printers collection in VB code.
Print To Network Printer
How can I print to a printer installed on the network, but not added to my computer.
I know the path of the printer (e.g //Computer/PrinterName). Is this information sufficient to send data to be printed on the network printer.?
Also what functions should I being looking into ??
Any help on this will be of great help to me
Regards
Aswin Asokan
[ASK]Check Shared Network Printer ??
Hello, I want to ask some question with VB6 ...
1. How to check the shared printer ready or not ??? I'm using Printer Epson LX300 connected to my PC using LPT1. Example my IP is 192.10.200.11 and the printer is shared as "20011". I try print using another computer without check, it works.
I got this code somewhere
Code:
Public Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" _
(ByVal pPrinterName As String, _
phPrinter As Long, _
pDefault As PRINTER_DEFAULTS) _
As Long
Public Declare Function GetPrinter Lib "winspool.drv" Alias "GetPrinterA" _
(ByVal hPrinter As Long, _
ByVal Level As Long, _
pPrinter As Byte, _
ByVal cbBuf As Long, _
pcbNeeded As Long) _
As Long
Public Declare Function ClosePrinter Lib "winspool.drv" _
(ByVal hPrinter As Long) _
As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Any, _
Source As Any, _
ByVal Length As Long)
' constants for PRINTER_DEFAULTS structure
Public Const STANDARD_RIGHTS_REQUIRED = &HF0000
Public Const PRINTER_ACCESS_ADMINISTER = &H4
Public Const PRINTER_ACCESS_USE = &H8
Public Const PRINTER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or _
PRINTER_ACCESS_ADMINISTER Or PRINTER_ACCESS_USE)
' constants for DEVMODE structure
Public Const CCHDEVICENAME = 32
Public Const CCHFORMNAME = 32
Public Type PRINTER_DEFAULTS
pDatatype As String
pDevMode As Long
DesiredAccess As Long
End Type
Type PRINTER_INFO_2
pServerName As Long
pPrinterName As Long
pShareName As Long
pPortName As Long
pDriverName As Long
pComment As Long
pLocation As Long
pDevMode As Long
pSepFile As Long
pPrintProcessor As Long
pDatatype As Long
pParameters As Long
pSecurityDescriptor As Long
Attributes As Long
Priority As Long
DefaultPriority As Long
StartTime As Long
UntilTime As Long
Status As Long
cJobs As Long
AveragePPM As Long
End Type
Public Const ERROR_INSUFFICIENT_BUFFER = 122
Public Const PRINTER_STATUS_BUSY = &H200
Public Const PRINTER_STATUS_DOOR_OPEN = &H400000
Public Const PRINTER_STATUS_ERROR = &H2
Public Const PRINTER_STATUS_INITIALIZING = &H8000
Public Const PRINTER_STATUS_IO_ACTIVE = &H100
Public Const PRINTER_STATUS_MANUAL_FEED = &H20
Public Const PRINTER_STATUS_NO_TONER = &H40000
Public Const PRINTER_STATUS_NOT_AVAILABLE = &H1000
Public Const PRINTER_STATUS_OFFLINE = &H80
Public Const PRINTER_STATUS_OUT_OF_MEMORY = &H200000
Public Const PRINTER_STATUS_OUTPUT_BIN_FULL = &H800
Public Const PRINTER_STATUS_PAGE_PUNT = &H80000
Public Const PRINTER_STATUS_PAPER_JAM = &H8
Public Const PRINTER_STATUS_PAPER_OUT = &H10
Public Const PRINTER_STATUS_PAPER_PROBLEM = &H40
Public Const PRINTER_STATUS_PAUSED = &H1
Public Const PRINTER_STATUS_PENDING_DELETION = &H4
Public Const PRINTER_STATUS_PRINTING = &H400
Public Const PRINTER_STATUS_PROCESSING = &H4000
Public Const PRINTER_STATUS_TONER_LOW = &H20000
Public Const PRINTER_STATUS_USER_INTERVENTION = &H100000
Public Const PRINTER_STATUS_WAITING = &H2000
Public Const PRINTER_STATUS_WARMING_UP = &H10000
Function CheckPrinterStatus(PrinterName As String) As String
Dim hPrinter As Long
Dim ByteBuf As Long, BytesNeeded As Long
Dim PI2 As PRINTER_INFO_2
Dim PrinterInfo() As Byte
Dim result As Long, LastError As Long
Dim tempStr As String
Dim NumJI2 As Long
Dim pDefaults As PRINTER_DEFAULTS
CheckPrinterStatus = ""
pDefaults.DesiredAccess = PRINTER_ALL_ACCESS
'Call API to get a handle to the printer
result = OpenPrinter(PrinterName, hPrinter, pDefaults)
If result = 0 Then
'If an error occured, display an error and exit sub
MsgBox "Cannot open printer " & PrinterName & ", Error: " _
& Err.LastDllError & "-" & Err.Number
Exit Function
End If
'Init BytesNeeded
BytesNeeded = 0
'Clear the error object of any errors
Err.Clear
'Determine the buffer size needed to get printer info
result = GetPrinter(hPrinter, 2, 0&, 0&, BytesNeeded)
'Check for error calling GetPrinter
If Err.LastDllError <> ERROR_INSUFFICIENT_BUFFER Then
ClosePrinter hPrinter
Exit Function
End If
'Due to a problem with GetPrinter, we must allocate a buffer as
'much as 3 times larger than the value returned by the initial
'call to GetPrinter.
ReDim PrinterInfo(1 To BytesNeeded * 3)
ByteBuf = BytesNeeded
'Call GetPrinter to get the status
result = GetPrinter(hPrinter, 2, PrinterInfo(1), ByteBuf, _
BytesNeeded * 3)
'Check for errors
If result = 0 Then
'Determine the error that occured
LastError = Err.LastDllError()
ClosePrinter hPrinter
Exit Function
End If
'Copy contents of printer status byte array into a
'PRINTER_INFO_2 structure to separate the individual elements
CopyMemory PI2, PrinterInfo(1), Len(PI2)
'Check if printer is in ready state
If PI2.Status = 0 Then
CheckPrinterStatus = "Ready"
Else
CheckPrinterStatus = PI2.Status
End If
'Close the printer handle
ClosePrinter hPrinter
End Function
I try using this code on my command button
Code:
Dim PrinterName as String
PrinterName = "\192.10.200.1120011"
MsgBox CheckPrinterStatus(PrinterName)
When I Run code above, I'm get msgbox "Cannot Open Printer \192.10.200.1120011". BUT IF I'm Using Printer Server, the code above will run (offcourse with different shared name and IP).
Can anybody help me, please ?? maybe there is another function ??
Thank you..
Print Method Not Found In Printer Object
When execute Printer.Print "aaa" within VB the program run correctly without message error but when go to make .exe file appeared an message error that say print method not found. I have open Object Browser and look into Printer object and not find there "Print" method. What problem exist? Where is the "Print" method?
Thanks
Problems With Printer Object.... No Print Method..
I'm trying to create a printer object, draw text onto it, and print it, but when i declare the printer object and try to add text to it using the print method, the method isn't listed in the dropdown box and complains "object needed" when i run the code. I've cut and pasted my code below.. maybe someone can tell me what I"m doing wrong??
thanks
Dim currentPrinter as Printer
currentPrinter.print "Some Text"
currentPrinter.EndDoc
Print DIRECTLY To A Network Printer
I've got a routine that sends a job to a printer.
The file type is .EPS. I've tried to sent using drivers but no joy.
VB Code:
Dim fso As New FileSystemObject Dim ts As TextStream Dim strData As String, Port As String Dim CreatePort As String, DeletePort As String 'Setup ports Port = PrintServer & Printer Open Port For Output As #10 'Open the port to "Print" to Set ts = fso.OpenTextFile(InputFolder & Fname) 'Open File for Output Do While ts.AtEndOfStream <> True strData = ts.Read(1) 'Put file into strData Print #10, strData; 'Send output to OPI Printer Loop 'Loop it!! Close #10 'Close the Port File ts.Close 'Close the FSO file
The problem I get is...
Prints to queue, when above finishes the print queue is still requesting data, hangs the printer and stops the Printer Spooler.
Any Ideas??
How Do You Print To A Specific Network Printer?
I am writing a program that prints to a receipt printer. I want to be able to connect 2 computers to this printer and print to it. The way I have it set up is this:
Open "LPT1:" For Output As #1
I shared the name for the printer is “receipt” How would I code to print to this?
Redirecting Print To A Network Printer
Someone was nice enough to give me the following code:
Function PrintFileDirectly(strfilename As String, _
Optional strPrinterPort As String = "LPT1")
Dim fFile, fPrn
Dim strBuffer As String
On Error GoTo Err_PrintFileDirectly
fFile = FreeFile
Open strfilename For Input As fFile
fPrn = FreeFile
Open strPrinterPort For Output As fPrn
strBuffer = Input(LOF(fFile), #fFile)
Print #fPrn, strBuffer;
Close fFile
Close fPrn
PrintFileDirectly = 0
Exit Function
Err_PrintFileDirectly:
PrintFileDirectly = Err.Number
Close
Exit Function
End Function
How do I incorporate the ability to print to a network printer. The current code only prints to the LPT1, printer. I would like to be able to print to any default printer (networked, mapped, etc).
Thanks for the help.
Print To A Network Printer Using UNC Path
Hi there..
I was wondering if is that possible to make a vb6 printer object to print to a network printer by using UNC path (eg: "\PrintServerMyPrinter" without quotes)
All I´ve got until now is printing to a network printer but installing them as a Local Printer, instead of remoting.. does anyone knows how to achive that?
I have seem many programs that can print to a network printer by entering just a UNC path...
Thanks in advance,
Otavio
Print Or Copy To Network Printer?
Hello all,
I have written a label program and I am stuck on the last step of sending the formatted file to our network printers. I tried using FileCopy, but it wouldn't allow me to copy my file to the destination.
FileCopy txtOrder & ".d00" \TallyT6180
So then I tried using a shell like this...
Dim ScriptCommand
Dim PrintShell as string
PrintShell = TESTDIRECTORY & "copy " & txtOrder & ".d00 \tally 6180"
ScriptCommand = Shell(PrintShell, vbHide)
VB tells me it cannot find the file when I run the shell, although it is there. Any ideas???
Thanks, Sean
Urgent Help Needed With Print Method Of Printer Object
This program are looking after pdf files in a directory. If a pdf file exists, it will find the size in strFormat (A4 or A3). By some other functions if finds the printer device name in strPrinterName.
So the problem is that I have to change the paper size, depending on the size found in strFormat. Look in the example.
This program is runing on a server, so there is no dialog...
Ex.
For i = 0 To Printers.Count - 1
If cSetPrinter.SetPrinterAsDefault(strPrinterName) Then
' This sets the printer as default
If strFormat = "A4" Or strFormat = "a4" Then
Printer.PaperSize = 9
Else
Printer.PaperSize = 8
End If
End if
Next
' Print out the PDF File
r = AcroExchAVDoc.printPages(0, (nMaxPage - 1), 1, 0, 1)
If I go to the Printer Settings and set the Paper size = "Letter Small, ..." ( = 2 !) and If I put the printer on pause..., and execute the program, the document in the printer queue will have the paper size = 2.
Please help...
Urgent Help Needed With Print Method Of Printer Object
Hi!
I have to add the printing feature to my application. I want to use the printer object. But for some reason, Print method of printer object does not appear in the list of methods that it displays. And if I type Printer.Print it gives me an error. I see other members of Printer object -currentX, CurrentY etc but not Print. Do I have to include something before using this object. Please help.
Thanks
NC
Access Print Report To Same Network Printer
Maybe this is too easy and I am trying to think too hard about this.
I have a report in access97 that automatically prints when the first person logs into my database on Monday. I am trying to setup the report so that it always prints to the same network printer no matter which individual logs in or from where. (They must be on the network to log in).
[Beenprinted] is just a check box in the forms underlying table that is used to make sure the report isn't printed twice on Monday. Here is the code that I want to add to so the report will always print to one particular network printer.
Code:
Private Sub Form_Load()
On Error GoTo Form_Load_Error
Dim Todaysdate As Integer
Todaysdate = DatePart("w", Now)
Select Case Todaysdate
Case 1
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 2
Dim stDocName As String
If Me![beenprinted].Value = False Then
stDocName = "rptContactBackNext7All"
DoCmd.OpenReport stDocName, acNormal
Me![beenprinted].Visible = True
Me![beenprinted].Value = True
Me![beenprinted].Visible = False
End If
Case 3
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 4
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 5
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 6
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 7
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
End Select
Form_Load_Exit:
Exit Sub
Form_Load_Error:
MsgBox Err.Description
Resume Form_Load_Exit
End Sub
Thanks in advance!
FireDrake
"Nothing I say this day will teach me anything, so if I'm going to learn I have to do it by listening." -Larry King
WebBrowser Control - Print To Specified Network Printer
Hi there, I have an application that prints 2 different HTML documents via. the WebBrowser control. I now need to print these 2 different documents on 2 different network printers. How would I go about doing this?
My current code: (to print to the default printer)
Code:
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
Print On Network Printer (default) Not Working
Hello,
I have a local printer installed (that is not the default printer) and a network printer that is the default.
If I send a report to print using datareports, printing is correct, but if I send something to print using the printer.print then nothing is printed.
The job is sent to the local printer instead!
I´ve read that VB is supposed to send whatever to the default printer... why then isn´t it working for the printer.print?
I need to print always to the default printer.
How Do We Print A File Through A Network Printer Using Command In VB? (Resolved)
Hi evrywan
Here's the scenario:
We are developing a system for a company which is using dot matrix printer. They require that the report be text-based, and can be fit into small papers. Hence, we'll go for text-based reports with ESC-P2 printer escape codes.
Problem is, this kind of report seems to require DOS printing in order for the printer to capture the printer code, because we tried to open a notepad and let user prints over it, the layout doesn't follow what as we desired (15 CPI or condensed printing etc)
If using DOS, we may as well just use "type filename.txt>\computernameprintername" to get it to print out at a network destination. So may I know how do we do that in VB?
Thanks for all of your attentions ^ ^
Edited by - amao on 5/5/2005 12:20:25 AM
Help::I Have A Big Proplem In Print Check On The Receipt Printer
Hi
i have a problem in
printing checks uesing a POS recepit printer
my code is
Printer.FontName = "Courier New"
Printer.FontSize = 10
'*** Report Header ***
Call PageHeader
'*** Detail Section ***
mrl.MoveFirst
Do Until mrl.EOF
Font.Size = 20
Printer.Print mrl!Quntitative & " | " & sText & " | " & mrl!unit_Price
mrl.MoveNext
Loop
'*** Report Footer ***
Printer.Print String(75, "-")
Printer.Print "*** End of Report ***"
Call PageFooter
'*** End Of Report ***
Printer.EndDoc
But in the Result
you can see the table
==========================================================
Code Description unit_Price
==========================================================
1001 | ABC TRADERS |11
1002 | XYZ BROTHERS | 12
1003 | FALCON CEMENT |10
1004 | NET CON EXPORTERS | 1
--------------------------------------------------------------------------
*** End of Report ***
and the question is how can i mack it lick that check
*** End of Report ***
Avoid Printer From Ejecting The Paper After The Last Line Printed? (VB - Printer.print)
how to stop the printer from ejecting the paper after the last line has printed?
assume i'm making an invoice for my small store, and i want to print the items my customer bought downward, so whether it's 1 item, or 5 items, or 100 items, i want the printer stop after the last item has printed ( plus my invoice's footer off course ). i am using VB 6, and 'printer.print' code to print and my printer is EPSON LX-300+. and my database is SQL Server 2000 Developer Edition. is there anyone can help? i really appreciate any help you offer
PS : i've been searching this forum and try all topics related to my issue but nothing's suitable for me...so if there's someone can be more specific, i would really appreciate it
How Can I Change The Default Printer At Runtime To Use It With Printer.print Command?
Hi everyone,
I have a little application which uses printer.print command to do some print jobs, of course there are some other things that I print using Data Reports.
When my application starts, I think it instantiates printer object with the default printer (lx300). Once the application is started, there are some options that use printer.print, but there are options that use printer.print too but I need to print them in another printer (ip1000). I have a common dialog that lets me choose the printer, and when I choose ip1000 every printer.print call goes to lx300. I assume there's no way to "reinstantiate" printer object to print in ip1000.
Also, when I close my application ip1000 becomes my default printer. Does the common dialog can select a printer without changing the Windows default printer like Word, Excel. do?
Thanks a lot for your help
How Can I Change The Default Printer At Runtime To Use It With Printer.print Command?
Hi everyone,
I have a little application which uses printer.print command to do some print jobs, of course there are some other things that I print using Data Reports.
When my application starts, I think it instantiates printer object with the default printer (lx300). Once the application is started, there are some options that use printer.print, but there are options that use printer.print too but I need to print them in another printer (ip1000). I have a common dialog that lets me choose the printer, and when I choose ip1000 every printer.print call goes to lx300. I assume there's no way to "reinstantiate" printer object to print in ip1000.
Also, when I close my application ip1000 becomes my default printer. Does the common dialog can select a printer without changing the Windows default printer like Word, Excel. do?
Thanks a lot for your help
Printer.Duplex - Network Printer Problem
I am having a problem that is driving me mad. Attempting to add a printer setup dialog to an application, however on certain network printers I cannot set Printer.Duplex to printDlg.Duplex.
It does work on some of the printers but not on others.
The network is WindowsXP and most of the printers are on the same server. I'm sure that many will recognize the code below, as it's the same code that exists on many of VB help forumns.
Private Sub UserPrinterSelect()
Dim NewPrinterName As String
Dim objPrinter As Printer
Dim strsetting As String
Dim printDlg As PrinterDlg
Set printDlg = New PrinterDlg
' Set the starting information for the dialog box based on the current printer settings.
printDlg.PrinterName = Printer.DeviceName
printDlg.DriverName = Printer.DriverName
printDlg.Port = Printer.Port
printDlg.Copies = Printer.Copies
printDlg.Orientation = Printer.Orientation
printDlg.PaperBin = Printer.PaperBin
printDlg.Flags = cdlPDPrintSetup
Printer.TrackDefault = False
If Not printDlg.ShowPrinter(Me.hwnd) Then
Debug.Print "Cancel Selected"
Exit Sub
End If
' Locate the printer that the user selected in the Printers collection.
NewPrinterName = UCase$(printDlg.PrinterName)
If Printer.DeviceName <> NewPrinterName Then
For Each objPrinter In Printers
If UCase$(objPrinter.DeviceName) = NewPrinterName Then
Set Printer = objPrinter
End If
Next
End If
' Copy user input from the dialog box to the properties of the selected printer.
Printer.Copies = printDlg.Copies
Printer.Orientation = printDlg.Orientation
Printer.Duplex = printDlg.Duplex
I also have tried:
Printer.Duplex = 1
Printer.Duplex = 2
Printer.Duplex = 3
All the values are valid but only 1 is accepted by the Print object.
I know that there has to be a way for me to set this property. I can do whatever I want in Word and Excel and it works.
Any ideas would be greatly appreciated... (and please keep it simple.. old programmer, new to VB)
Printer Not Responding To Printer.Print --> Help Newbie
First... I am depressed like hell to get this to work.
Problem: I have an "Eltron 310" ID Card Printer. I am trying to do
Printer.PaintPicture IMG_ID,0,0 (where IMG_ID is a picture)
Printer.EndDoc
The above
--> Works with normal printer
--> Does not work with ID Card Printer. ID Printer doesn't even respond to the command, Printer.PaintPicture, nor does it respond to Printer.Print "some text"
PLEASE HELP. ANY CODE IS GREATLY APPRECIATED.
Thanks
Sreeni
Printer Not Responding To Printer.Print --> Help Newbie
First... I am depressed like hell to get this to work.
Problem: I have an "Eltron 310" ID Card Printer. I am trying to do
Printer.PaintPicture IMG_ID,0,0 (where IMG_ID is a picture)
Printer.EndDoc
The above
--> Works with normal printer
--> Does not work with ID Card Printer. ID Printer doesn't even respond to the command, Printer.PaintPicture, nor does it respond to Printer.Print "some text"
PLEASE HELP. ANY CODE IS GREATLY APPRECIATED.
Thanks
Sreeni
? Printer Should Print Your Current Printer - Correct?
I am right in assuming that if I run a standard .exe program and I pause it...then type in the Immediate window the following:
Code:
? Printer
then it should come up with the default printer name - correct? Please let me know if I'm wrong.
Thanks,
Stephen
How To Printer.Print To Non Default Printer
I have a small app that I need to modify. Basically it sends a report straight to the (default) printer by Printer.Print
Users want to print to their non-default printer, too. I could change the default printer by Set Printer = another Printer and then get back to the original one, but is there a better way to do it?
Have fun.
---- Andy
&"Printer.print & Printer.currentx/y&"-question
Hello,
Im kinda a newby (not really), but i need some answers to newby questions...
I got a nice program wich outputs data on my form...
NOW, i want to print the information with my printer...
and i've read some stuff about it... and found the "Printer.print"-method the best solution...
SO, now I got some questions about it...
--> when i say "printer.currectx = 250", then where will the printer print my stuff??
- at 250 mm from the leftmargin
- at 250 mm form the paper
- at 250 pixels from the leftmargin
- at 250 pixels from the paper
- at somewhere else
What i'dd like is it be printed at 25 mm from the paper...
tnx anyway....
How Can Print To Local Printer Using &"Printer.port&"
Hi all, I have a local printer which is connected to one computer. I use the code printer.port which works well and prints to printer. But when i try to print from another computer which is a lan it gives the error "Bad file number".
How can i do this
Printer Method
How to use the Printer method? How can I set the Paper size and margin?? help help help please??
Print Error 486: Can’t Print Image To This Type Of Printer
Hey all
Has anyone seen this error when trying to initiate printform? I am trying to printform in a loop and it gives me this error. The printall subroutine has my printform code. It works perfectly the first time but when it tries to move to the previous record and then print that one I get this error. I searched for information but only found one suggestion where someone suggested putting a time delay in there. I tried that and it still would not print the second time. Help please.......
Thanks so much
Kim
Here is my code:
Code: Private Sub cmdPrintAllForms_Click()
On Error GoTo SubErr
Dim i As Integer
Dim rs As ADODB.Recordset
Set oConn = New ADODB.Connection
oConn.Open frmSplash.sConn
strSQL = "select * from tblAircraftWO where work_order_no = " & txtWorkOrderNo.Text
Set rs = New ADODB.Recordset
rs.Open strSQL, oConn, adOpenKeyset, adLockOptimistic
i = rs.RecordCount
rs.AbsolutePosition = txtCardNo.Text
Do While Not rs.BOF
PrintAll
rs.MovePrevious
If Not rs.BOF Then
RetrieveRecords
End if
Loop
If rs.BOF Then
rs.MoveFirst
MsgBox "You are at the beginning."
End If
SubExit:
Exit Sub
SubErr:
MsgBox Err.Number & ": " & Err.Description
Resume SubExit
End Sub
Getting Network Printer IPs
Dear All,
Can VB6 used to get the IP addresses of the network printers installed in my PCs?
My PC is part of a small company network where we share a few printers. I need to write a small VB app that can print directly to the printer by their IP addresses. I've done some research but failed to come up with any VB6 code that can return me the IP addresses of the network printers.
Hope to hear from you soon. Thank you in advance.
Newbievb05
Network Printer
Hi, all:
How can I set it for a network printer and how to get file back from the printer server from my desktop? I don't have admin right.
Thanks,
Mike
How To Get All Printer On Network
hi
i want to get all printers which are install on my system and also i get print from that printer which i select with his properties.
thanks
Hammad Umar
Any One Know How To Add A Network Printer
I am trying to write an app that allows the user to simply click and connect to a network printer without using the Add Printer Wizard. Anyone know of any code that will do this. I have tried one or two but none seem to work. If you know of any places I can get the code from or just email it to me if needed, Cheers
Shauny Shaun.
Left is Right, but Up is Down so which is the right way round!?
Specifying A Network Printer
I had put together a Point of Sale system on my network. I designed a printout using the Printer object. The problem that I am having is that some people using this on my network are setup to a different default printer than the one that the prinout needs to come out of. Does anyone know how I can specify the correct printer in the code?
Brian
Network Printer
How do I select printer on the network.
(everything programmatically using vb.)
and from manufactures list
how do I select printer of particular vendor that of postscript type.
Any help,
Milind.
|