How Implement FilePrintSetup (part of Word Application)

vittorio1973vittorio1973 Member Posts: 26
Good Afternoon,

I need to implement the following code in NAV

Set oWord = CreateObject("Word.Application")
oWord.WordBasic.FilePrintSetup Printer:="HP LaserJet 4 on LPT2", _
DoNotSetAsSysDefault:=1


Exactly I am not able to do the second VB line code
I have defined oWord as 'Microsoft Word 12.0 Object Library'.Application variable
But as soon as I try to implement oWord.WordBasic I receive the following error
"The returned value should be used for this function"

Please help since I am not able to print on a different printer than the default one using Citrix
Thanks for your help

Comments

  • amazanamazan Member Posts: 17
    Hi vittorio1973,

    Why don't you try to use ActivePrinter property from WordApp?.
    Something like this:
    DefaultPrinter := WordApp.ActivePrinter;
    WordApp.ActivePrinter := NewPrinter;
    .
    .
    .
    //do something
    .
    .
    .
    WordApp.ActivePrinter := DefaultPrinter;
    

    :wink:
  • vittorio1973vittorio1973 Member Posts: 26
    Hi thanks for your reply,
    I have already tried to do that and it works in a normal environment but on CITRIX it doesn't work.
    In fact, when I use your suggested procedure on Citrix NAV ignores the selected printer and it prints on the default printer.
    That is why I am trying another alternative that is the one I have written but I don't know how to implement it on C/Side, so if you have any suggestions about that please let me know
    Thanks
  • vittorio1973vittorio1973 Member Posts: 26
    Hi All,

    has anybody got any suggestions to my issue?
    Or about how to write the code in C/Side or any alternative solution to avoid Citrix from continuing to print using the default printer?
    Thanks a lot
  • vittorio1973vittorio1973 Member Posts: 26
    Hi again,
    since it is very important, please can anybody give me any suggestions to resolve my issue?
    Thanks
Sign In or Register to comment.