Copy Text to the Clipboard

Big_DBig_D Member Posts: 207
Hi mibuso.com

In NAV 2009 R2 I used the Automation routine 'CSIDEClipboard'.Text to copy Text out of NAV to the Clipboard. This works great but now want to do the same thing in NAV 2018 - how is this possible please?
Big D signing off!

Best Answers

  • sb_sb_ Member Posts: 5
    Answer ✓
    With a dotNet Variable.
    Clipboard DotNet System.Windows.Forms.Clipboard.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Clipboard.SetText('Text to Clipboard');
  • SigGunnSigGunn Member Posts: 18
    Answer ✓
    Hi Big_D

    Set the RunOnClient property of the dotnet variable as Yes.

    1fh6n85a7xwz.png
  • Big_DBig_D Member Posts: 207
    Answer ✓
    Wahey SigGunn

    That works a treat - you're a star :) !

    See you can even read the Clipboard too <3!
    CopyAddrTest()
    Clipboard.Clear;
    Clipboard.SetText ('Testing Clipboard for NAV2018 Upgrade'); //Copy text to Clipboard
    IF Clipboard.ContainsText then //Does Clipboard have text - even reads clipboard generally!
      MESSAGE ('(%1)', Clipboard.GetText); //Display Clipboard
    

    Keep up the good work!
    Big D signing off!

Answers

  • sb_sb_ Member Posts: 5
    Answer ✓
    With a dotNet Variable.
    Clipboard DotNet System.Windows.Forms.Clipboard.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Clipboard.SetText('Text to Clipboard');
  • TallyHoTallyHo Member Posts: 415
    Does anybody know how to do the same in the webclient?
  • Big_DBig_D Member Posts: 207
    Hi SanderDk and sb_ for the solution :) !

    All the code was there but getting this error message ...

    7brvttchl713.png

    Not done any dotnet stuff to date in NAV - other than call Clipboard.SetText('Text to Clipboard'); - do I need to do anything else?
    Big D signing off!
  • SigGunnSigGunn Member Posts: 18
    Answer ✓
    Hi Big_D

    Set the RunOnClient property of the dotnet variable as Yes.

    1fh6n85a7xwz.png
  • Big_DBig_D Member Posts: 207
    Answer ✓
    Wahey SigGunn

    That works a treat - you're a star :) !

    See you can even read the Clipboard too <3!
    CopyAddrTest()
    Clipboard.Clear;
    Clipboard.SetText ('Testing Clipboard for NAV2018 Upgrade'); //Copy text to Clipboard
    IF Clipboard.ContainsText then //Does Clipboard have text - even reads clipboard generally!
      MESSAGE ('(%1)', Clipboard.GetText); //Display Clipboard
    

    Keep up the good work!
    Big D signing off!
Sign In or Register to comment.