Copy to clipboard with VB or C#
I'm looking to build a simple "copy to clipboard" script in VB or C# to run in a workflow. It seems like this should be very straight forward and I've found loads of sample code online but I can't get any of it to work.
I've been trying to get this to work but it can't even find "thread" as a type:
Dim ThreadA As Thread
ThreadA = New Thread(AddressOf Me.MyAsyncTask)
ThreadA.ApartmentState = ApartmentState.STA
ThreadA.Start()
Private Sub MyAsyncTask()
Clipboard.Clear()
Clipboard.SetText("TextToCopy")
End Sub
any help/pointers?
thanks!
0
-
Hi Lauren,
I'm sorry to say that this is not possible. The reason being that the VB and C# activities are server side, and are not able to set the clipboard on the client side. It may be possible to build a custom command that will do this, but that would require some developer time. I would suggest reaching out to your account manager to discuss that.
You can also submit this to the ideas section (https://support.geocortex.com/GSCIdeas?c=09a6000000008RsAAI&filter=1&categ=all&sub-nav=ideas&main-nav=essentials&page=1). We may be able to build a workflow activity that can do this, and include it in a future release of the product.
I hope this helps!
Thanks,
Danny0
Please sign in to leave a comment.
Comments
1 comment