Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Melbourne, Australia
    Thanked 0 Times in 0 Posts

    hide doc code errors, show doc code works (Word 2002 XP SR3)


    in summary the code does the following....from a Word document generates a printer postscript file, opens the ps file (hidden) and applies printer settings eg holepunching or duplexing, 2-UP etc. and then sends and spools the postscript file to the printer. pls dont ask why it was done this way..its a long story [img]/forums/images/smilies/smile.gif[/img]

    with my code i open and hide the document file, so the end user doesnt view the processing taking place.
    for debugging purposes i show the document so i can see the processing taking place.

    on the "old" printers opening up the postscript file in Word as hidden worked.

    However I noticed on the new generation of printer models (Multifunctional devices MFDs), in Word opening the hidden postscript file no longer works. the code only works if the postscript file is viewed.

    although i dont understand why having the file hidden or not would make a difference *shrug*

    heres the code...

    ' Open up the file as a hidden document. (this will switch off the screenupdating
    ' for the duration of processing on the document.)
    ChangeFileOpenDirectory strTempFolder
    Set docTmp = Documents.Open(FileName:=strFileName, Format:=wdOpenFormatAuto, Encoding:=1252, Visible:=False)
    '' dd. for debugging purposes only, view the file
    'Set docTmp = Documents.Open(FileName:=strFileName, Format:=wdOpenFormatAuto, Encoding:=1252, Visible:=True)


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: hide doc code errors, show doc code works (Word 2002 XP SR3)

    If you need the file to be visible, you can set

    Application.ScreenUpdating = False

    at the beginning of the macro, and

    Application.ScreenUpdating = True

    at the end to hide most of what;s going on from the user.

Posting Permissions

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