Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 - Using the Clipboard

Status
Not open for further replies.

jsfrocha

Computer
Joined
Aug 12, 2011
Messages
1
Location
PT
Hello,

I had some lessons about VB in the past and i can only remember the basics.

My current job requires me to do several routine tasks which i think could be more efficient by applying some programming to it. I'm also currently studying Computer Engineering but we're focusing more on C and Java, and i dont really remember the VB Code.

So here's what i need to do at my current job, at an customer support service:

I need to take the username of the person, lets say X and put it in a line of text like so: "text.text.text ( X , X , X , X )"

So i thought i could make it more efficient (i normally take the user X and paste it Y times manually) by using a VB form.

It would work like this: I would put the user X in the form, then it would be transferred to the clipboard and pasted in certain spots in a predefined line of text, and then return the final line of text to my clipboard, so i could paste it where i need to.

I think this is rather easy to accomplish on VB, could i get some tips on how to do it ?

Thanks guys, and i'm hoping i made myself clear in all this mess =)
 
The simplest solution, I think, is to use whatever concatenate function there is. Then you simply build up the string by concatenating your text, something like

concatenate("text.text.text ( ", name, ",", name, ",", name, ")")


Pasting into an existing string could be done, but you'd need to reserve sufficient white space to hold the longest name you want to handle. This would be simply reassigning the value of str[n]=letter1, str[n+1]=letter2, etc.

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
Check out TEK-TIPS.com a sister site to this one where the computer geeks live.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top