Auto print document when opening

  • I am using Word 2000 and I want a particular document to automatically print out when I open the file. So far I can only come up with the following code:


    Code
    Private Sub Document_Open()
        ActiveDocument.PrintOut
    End Sub


    Any help is much appreciated!

  • Re: Auto print document when opening


    Think you need something more along the lines of;


    Code
    Private Sub Workbook_Open()
    
    
    Sheets("SheetNameHere").Activate
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    
    
    End Sub


    Hope that helps,
    Ian

  • Re: Auto print document when opening


    Are you getting any error messages, or is it simply that nothing is happening? Double check that your default printer is setu up correctly.


    Ian

  • Re: Auto print document when opening


    The document opens and then nothing happens, if I click the print button on the toolbar the document then prints.


    Paul

  • Re: Auto print document when opening


    pmorris, check that your macro security setting is on medium or low or the macro won't work


    Tools>Macro>Security


    :rock:


    Colin

  • Re: Auto print document when opening


    Quote from pmorris

    I am using Word 2000 and I want a particular document to automatically print out when I open the file. So far I can only come up with the following code:


    Code
    Private Sub Document_Open()
        ActiveDocument.PrintOut
    End Sub


    Any help is much appreciated!


    Works fine for me - are macros enabled or macro security level set to medium

  • Re: Auto print document when opening


    Thanks


    It was the security issue, now it works great, this is the code I eventually used:


    Code
    Private Sub Document_Open()
        Documents("document_name").PrintOut
    End Sub
  • Re: Auto print document when opening


    Quote from IanDunnett

    Think you need something more along the lines of;


    Code
    Private Sub Workbook_Open()
    
    
    Sheets("SheetNameHere").Activate
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    
    
    End Sub


    Hope that helps,
    Ian


    Try changing the above to read;

    Code
    Private Sub Workbook_Open()
    
    
    Sheets("SheetNameHere").Activate
    Sheets("SheetNameHere").cells(1,1).Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    
    
    End Sub



    Failing that send the print keys to the program, i.e.;



    Let me know if it's still a problem.
    Ian

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!