Copy text form Word Doc to form

  • Thread starter Thread starter DavPet
  • Start date Start date
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?
 
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.
 
Back
Top