Copy Textbox contents to clipboard

A

aureus

Dear all,

I do a lot of repetitive typing at work. I have a list of templates which I
want handy around. I am thinking of having a word document with textboxes
which are holding my different templates. I am hoping to have a button beside
each textbox so that when I click it, it will automatically copy the
textbox's contents to the clipboard.

I can then paste these onto the software which I am doing data entry to.

I have tried stuff like "textbox1.copy" but this does not work. Nothings
goes onto the clipboard. What am I missing?

Sorry this is my first attempt at programming, so to speak... anyone can help?
 
G

Greg Maxey

aureus,

Have your tried AutoText?

Say your type the following 100 times a day:

"I do a lot of repetitive typing at work. I have a list of templates
which I want handy around. I am thinking of having a word document
with textboxes which are holding my different templates. I am hoping
to have a button beside each textbox so that when I click it, it will
automatically copy the textbox's contents to the clipboard."

Select it, press Alt+F3 and create an AutoText entry.

Go to Tools>AutoCorrectOptions>AutoText and make sure the checkbox "Show
AutoText Suggestions is Checked."

Start to type: I do a ... and when the AutoText tip pops up, press Enter.

HTH
 
A

aureus

Hi Greg, thks for ur reply...

Have thought of that but I am actually typing the text into another
application, no Word... so short of getting some shareware programme to do
some macros, I was thinking of what I can do with Word...
 
H

Helmut Weber

Hi Aureus,

I wonder whether your approach will make you happy.
But, if it has to be, this may get you started:

Private Sub CommandButton1_Click()
ActiveDocument.Shapes(1).TextFrame.TextRange.Copy
End Sub

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
H

H Dodson

Aures,
I too was looking to copy text out of word and paste them into another
program. I also am program illiterate. What I have done is set up a form
where I enter in text form fields and protect the document. This way I tab
thru the document and enter only the new data (is this what you do?) I have
created a macro (with much help from this community) that runs after my word
document is done. (I push a button on my tool bar) The macro does the
following
Unprotects the document (so that I can select the document)
Selects the whole document
Copies the document
Closes the document
Represses the save prompt
I then can use the CTRL+V and dump the information in my other product-which
is an adobe product. If this sounds like something that will help, here is
the code:

ActiveDocument.Unprotect
Selection.WholeStory
Selection.Copy
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top