i am using following code to print unicode data from visual basic6 ( through using MSForm2 object ) but Fail to get any output from printer..please Help
StopPrinting = False
On Error GoTo errhandler
cmd1.PrinterDefault = True
cmd1.CancelError = True
cmd1.Flags = cdlPDReturnDC + cdlPDNoPageNums
cmd1.ShowPrinter
Printer.FontName = "Jameel Noori Nastaleeq"
Printer.Print TextBox1.Text
Printer.EndDoc
Exit Sub
errhandler:
Select Case Err
Case 32755
MsgBox "you cancelled the dialog box"
Case Else
MsgBox "Unexpected error. Err " & Err & " : " & Error
End if
I have also used another code but no response from printer : still blank paper only.
Private Declare Function TextOutW Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Sub cmdPrint_Click()
Dim x As Long
Dim str As String
str = txturdu.Text
Printer.ScaleMode = 6
Printer.FontName = "@Arial Unicode MS"
Printer.FontSize = 9
Printer.CurrentX = 150
Printer.CurrentY = 100
Printer.Print " "
x = TextOutW(Printer.hdc, 160, 100, StrConv(str, vbUnicode), Len(str))
Printer.EndDoc
End Sub
The Jameel Noori Nastaliq font used in the first example is indeed correctly installed.
Nobody have solution about my problem