Options

Copy Text to the Clipboard

Big_DBig_D Member Posts: 203
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

  • Options
    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');
  • Options
    SigGunnSigGunn Member Posts: 18
    Answer ✓
    Hi Big_D

    Set the RunOnClient property of the dotnet variable as Yes.

    1fh6n85a7xwz.png
  • Options
    Big_DBig_D Member Posts: 203
    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

  • Options
    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');
  • Options
    TallyHoTallyHo Member Posts: 383
    Does anybody know how to do the same in the webclient?
  • Options
    Big_DBig_D Member Posts: 203
    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!
  • Options
    SigGunnSigGunn Member Posts: 18
    Answer ✓
    Hi Big_D

    Set the RunOnClient property of the dotnet variable as Yes.

    1fh6n85a7xwz.png
  • Options
    Big_DBig_D Member Posts: 203
    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.