Results 1 to 2 of 2

Thread: Word Automation and PCL Codes

  1. #1

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Word Automation and PCL Codes

    I am creating a word document on the fly and I am trying to use the Word Print field to send PCL code to the printer. However, when I try this the printer does not seem to respond to the codes that are sent. If I manually modify the document that was created through my automation process, it also does not work. If I create a brand new document and send it the printer commands, it works perfectly. So I think it is an issue with the document I am creating.

    Has anyone run into this before?

    Here is the code I use to create the print field:

    VB Code:
    1. m_App.Selection.Fields.Add(Range:=m_App.Selection.Range, Type:=Word.WdFieldType.wdFieldEmpty, Text:= _
    2.                 "PRINT 27""&l2S""", PreserveFormatting:=False)

    And here is the code I use to create a new document:

    VB Code:
    1. Public Sub New()
    2.             m_App = New Word.Application
    3.             m_Doc = m_App.Documents.Add
    4.         End Sub

    Any advice would be greatly appreciated.

  2. #2

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Word Automation and PCL Codes

    Well, I have found that it looks like it has nothing to do with my code. It looks like that the print commands do not send properly when I have a header in the document.

    Does anyone know how I can get the printer to receive my PCL commands if I have a header on my document?

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