Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Feb 2003
    Location
    Renfrewshire, Scotland
    Posts
    35
    Thanks
    2
    Thanked 1 Time in 1 Post

    Printer codes (2000)

    I want to send printer escape codes to a network printer from a Word macro but I'll probably want to port it to Excel and maybe others. Basic problem is to tell printer to switch duplex on/off but other features of the printer may be used. Application.PrintOut options don't help. I used to do this all the time from DOS and it was never a problem. Any ideas anyone?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Printer codes (2000)

    Word has a field code, PRINT, that you can use to send control codes to a printer. I'm not sure where you would position it so that the code would take effect properly - beginning of document? beginning of header? - you might experiment. Now... as for Excel, I have no idea.

    MSKB on PRINT field: Word Print

  3. #3
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printer codes (2000)

    Since you know how to do it from DOS how about just call the .bat file from Excel and execute it. I'm assuming you'd write a batch file (.bat) and then make some system call (sytnax ??) from Excel VBA to run it.

    There are probably Win32 API calls too but I've only played with a few of the simple ones. Check out
    http://www.helpmaster.com/hlp-develo...ds-hdg2api.htm and many other sites that list the calls and their usage.

    Thnx, Deb

  4. #4
    Lounger
    Join Date
    Feb 2003
    Location
    Renfrewshire, Scotland
    Posts
    35
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Printer codes (2000)

    PRINT field looks like it should be the correct way to do this but it doesn't seem to work with all codes and/or printer drivers. I found lots of other stuff on the web that explains why it doesn't always work but not much in the way of fixes or workarounds. I've got round it by putting up a message box reminding me to check the relevant required settings before printing. A bit neanderthal lateral thinking but there you go. Thanks to all who made suggestions

    DougieW

Posting Permissions

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