Results 1 to 40 of 40

Thread: [RESOLVED] Printer Document Name

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Resolved [RESOLVED] Printer Document Name

    When I use API, I can do this:
    VB Code:
    1. Private Type DOCINFO
    2.     cbSize As Long
    3.     lpszDocName As String
    4.     lpszOutput As String
    5.     lpszDatatype As String
    6.     fwType As Long
    7. End Type
    8.  
    9. Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
    10. Private Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (ByVal hdc As Long, lpdi As DOCINFO) As Long
    11. Private Declare Function EndDoc Lib "gdi32" (ByVal hdc As Long) As Long
    12. Private Declare Function StartPage Lib "gdi32" (ByVal hdc As Long) As Long
    13. Private Declare Function EndPage Lib "gdi32" (ByVal hdc As Long) As Long
    14.  
    15. Private Function PrintTest(ByVal hPrintDc As Long)
    16.     Dim Result As Long
    17.     Dim di As DOCINFO  'Structure for Print Document info
    18.    
    19.     di.cbSize = 20   ' Size of DOCINFO structure
    20.     di.lpszDocName = "Document Name: 1234567..."
    21.     Result = StartDoc(hPrintDc, di) ' Start a new print document
    22.  
    23.     '...... the rest of the code...
    24. End Function
    It will print on the printer with a document name, but when I don't use API, how can I set the document name ?

    For example:
    VB Code:
    1. Private Function PrintTest()
    2.     [COLOR=Red][B]Printer.DocumentName = "Document Name: 1234567..."[/B][/COLOR]
    3.     Printer.Print "testing..."
    4.     Printer.EndDoc
    5. End Function
    The printer does not have a DocumentName property, so I cannot do that, but how else ?

    Can I mix the 2, and set the document name using api, but print on the printer object ?
    Last edited by CVMichael; Dec 15th, 2006 at 04:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width