vb.net - How do I copy from, erase, then paste back into the clipboard? -


i have automate program outside of control. way i'm doing use sendkeys.sendwait("keys") other program. problem is, there multiple fields might active , no way select single 1 confidence. fields different lengths, solution copy long, copy clipboard, , @ last character made though, know field selected in other program. overrides clipboard, unfortunately.

so, need these things.

  1. copy clipboard contents, anything, variable.
  2. send bunch of things other program , copy it. use other things.
  3. copy first variable clipboard.

ideally, able copy clipboard (images, text, rich text) , place nothing happened. here's i've got far, erases whatever in clipboard, or replaces special can't pasted notepad.

appactivate("otherprogram") dim oldclipboard idataobject = clipboard.getdataobject //'type long stuff, select all, cut clipboard sendkeys.sendwait("{esc}{f3}1234567890abcdefghijklmnopqrstuvwxyz" + "+{home}^x") dim selectedfieldtext string = clipboard.gettext dim lastchar string = selectedfieldtext.substring(selectedfieldtext.length - 1, 1) select case lastchar     case "4"         //'do nothing. we're in correct field.     case "j"         sendkeys.sendwait("+{tab}")     case "o"         sendkeys.sendwait("+{tab}+{tab}")     //'...and on end select //'send data correct field in "otherprogram" clipboard.setdataobject(oldclipboard) 

if haven't done coding on project yet, i'd highly recommend autoit.

it programming language built automation of existing programs. since using vb.net, has familiar basic syntax.

it click buttons, handle clipboard , and generates native executable.

building nice guis in easy. mature, stable , free!

really, favor , check out.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -