Copy text form Word Doc to form

D

DavPet

I have a form that displays a Word document and a few fields. I highlight
text in the Word doc, copy, then paste it into a selected field.

How can I add a button that would copy the highlighted text to a selected
field?
 
J

John Nurick

It's not very simple, and I've never done it myself. Code running bheind
the Access form would have to do something like this

- keep track of which control on the form is selected so you know which
field to put the Word data into (clicking the button moves the
selection)

- get a reference to the Word document object corresponding to the
document that the user has activated and selected something in;

- check that the selection is something that can meaningfully be placed
into the field in question (e.g. you can't put text into a numeric
field, or formatted text such as a table into a text field).

- copy the selection to the clipboard (that's easy)

- retrieve it from the clipboard and update the field.
 

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