missing something fundamental?

  • I'm redoing an old project was on Wordbasic with macro printings.

    What I need is read my installed printers, pick the one I want to use.

    I'm testing this codes example from here Retrieve installed printers list from MS.






    and I'm getting basic errors on varies lines;


    1) Dim prtloop As Printer (complie error- User-define type not defined)

    2) Application.Printers (complie error- Method or data member not found)


    I also saw other codes that could do this easily with "application.Printers"

    For some reason my environment in Word 2016 only accept application.Printer, not application.Printers!


    I know I'm failing something fundamental.


    Could someone pointing me what I'm missing?

    THANK YOU,

    Phi:)

    Edited once, last by royUK: add code tags ().

  • The Application object in Word does not have a Printer property. Try the following (uses Access's Application object to access the printers):

    Obviously, adjust the above to suit your needs.

  • Thank you guys.

    But my local or online Office Word 2016 would not takes these:

    xlDialogPrint

    Dim oAcc As Object


    Not sure how my Word 2016 would get this one: uses Access's Application object to access the printers


    So far I can get Application.activeprinter and Appication.Dialog(wdDialogFilePrintSetup).show

    But that only give me the default printer name or manually select a printer by dialog, but not give me name of printers.


    Highly appreciated for any help.

    Thanks,

  • Try this. I have ad apted some code of Chip Pearson.


    There's a basic message box to test it, but I have included a UserForm that list printers and allows the user to switch temporarily

Participate now!

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