Form Field - copy and paste

4

4charity

I have created some forms, that when the user is done filling in, they
unprotect the document, and then copy and paste the information into an
email. This works fine, however, the information that is in fields (for
instance, check boxes), does not show up in the pasted text. How can I get
the information to copy and paste?

TIA
 
G

Graham Mayor

It is unreasonable to expect users to jump through hoops to provide the data
that you want. Create a macro that extracts the data from, the form and
mails that, or better still (as users may not allow the macros) get the
user to e-mail the completed form and extract the data from the completed
form - see http://www.gmayor.com/ExtractDataFromForms.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
4

4charity

I guess I wasn't very clear in my request for help. This MailMerge document
is the last step of an already overtaxed program - which is barely chugging
away on our equipment. The MailMerge is the compilation of the data needed
from Access - nicely put into formatted letters, and also for the text for an
accompanying email. The letter is either printed or attached to the email,
and the body of the email is in a format required by our auditors. I chose to
use a form for the MailMerge template so that I could have a few checkboxes -
to make the body of the Email look a little nicer.

If it is not possible to copy and paste these checkboxes, fine - we can live
without them. But if someone does know how to do it *if possible*, that would
be great.
 
G

Graham Mayor

Word document form fields are not compatible with html e-mail format (and
certainly not with plain text format) so you will not be able to use them in
the body of an e-mail document. You may be able to use the check box from
the activex palette, but this will cause alarm bells in some users' security
systems, as the default is not to allow activex controls to run, because of
their potential to carry malicious code.

I had assumed that you were expecting remote users to mess around with the
form, but if you are doing it at your end of the process, as I suggested
earlier you should be able to read the results of the form fields using vba
(instead of copy paste) and write the results of the fields to the message
body; or conditionally insert tick box character when the result of a form
field check box is true (conversely an unticked check box character when it
is false). The following code, run on the form before you transfer it to the
mail message, will change all the form fields to plain text and insert
Wingdings characters in place of the check boxes. The users won't be able to
check or uncheck them, but they will give a representation of the form,
which seems to be what you want.

Dim oRng As Range
With ActiveDocument
If .ProtectionType <> wdNoProtection Then
.Unprotect
End If
For i = .FormFields.Count To 1 Step -1
Set oRng = .FormFields(i).Range
With oRng
.Text = ActiveDocument.FormFields(i).Result
If .Text = "1" Then
.Text = Chr(254)
.Font.name = "Wingdings"
.Font.Size = 14
End If
If .Text = "0" Then
oRng.Text = Chr(111)
.Font.name = "Wingdings"
.Font.Size = 14
End If
End With
Next i
End With

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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