Loosing FORMDROPDOWN text when sending e-mail

P

psantos

I created a form in Microsoft Office Word 2003. I have several types of
fields to colected information and a few FORMDROPDOWN fields to let the user
choose from possible limited options.
I have a macro that sends the form with the command Application.
ActiveDocument.MailEnvelope to an e-mail recipient.
Everything works fine, I receive the filled out form in Outlook, all the
information is there EXCEPT for the option selected in the FORMDROPDOWN
fields. It shows no text, not even the first element of the list, which is
always visible when you open the form.
If anyone could help me with this it would be great.

Thank you.
 
C

Cindy M -WordMVP-

Hi Psantos,
created a form in Microsoft Office Word 2003. I have several types of
fields to colected information and a few FORMDROPDOWN fields to let the user
choose from possible limited options.
I have a macro that sends the form with the command Application.
ActiveDocument.MailEnvelope to an e-mail recipient.
Everything works fine, I receive the filled out form in Outlook, all the
information is there EXCEPT for the option selected in the FORMDROPDOWN
fields. It shows no text, not even the first element of the list, which is
always visible when you open the form.
The problem is that an Outlook email is not a Word document. At best, Outlook
email is HTML. But a word form field isn't "translated" to HTML. The document
would have to be sent as an attachment for the all form fields to come through
correctly.

Since you're using a macro, you could process the form fields in the macro
before sending the letter (convert them to plain text, for example).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
P

psantos

Thank you for the swift response. Could you help me with that convertion to
plain text?
I have an on_entry macro associated with a CHECKBOX, when the user ticks the
checkbox, it automatically sends the document as an e-mail message text.
Is there any command I can put in that macro to be executed before sending
the e-mail that converts all the contents of the fields to plain text?
Thank you for your help.

Santos
Hi Psantos,
created a form in Microsoft Office Word 2003. I have several types of
fields to colected information and a few FORMDROPDOWN fields to let the user
[quoted text clipped - 5 lines]
fields. It shows no text, not even the first element of the list, which is
always visible when you open the form.

The problem is that an Outlook email is not a Word document. At best, Outlook
email is HTML. But a word form field isn't "translated" to HTML. The document
would have to be sent as an attachment for the all form fields to come through
correctly.

Since you're using a macro, you could process the form fields in the macro
before sending the letter (convert them to plain text, for example).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
 
D

Doug Robbins - Word MVP

With ActiveDocument
.Unprotect
.Fields.Unlink
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

psantos said:
Thank you for the swift response. Could you help me with that convertion
to
plain text?
I have an on_entry macro associated with a CHECKBOX, when the user ticks
the
checkbox, it automatically sends the document as an e-mail message text.
Is there any command I can put in that macro to be executed before sending
the e-mail that converts all the contents of the fields to plain text?
Thank you for your help.

Santos
Hi Psantos,
created a form in Microsoft Office Word 2003. I have several types of
fields to colected information and a few FORMDROPDOWN fields to let the
user
[quoted text clipped - 5 lines]
fields. It shows no text, not even the first element of the list, which
is
always visible when you open the form.

The problem is that an Outlook email is not a Word document. At best,
Outlook
email is HTML. But a word form field isn't "translated" to HTML. The
document
would have to be sent as an attachment for the all form fields to come
through
correctly.

Since you're using a macro, you could process the form fields in the macro
before sending the letter (convert them to plain text, for example).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
 
P

psantos via OfficeKB.com

Thank you, Doug.
I added that piece of code to my macro and it worked like a charm. With just
a slight problem: after the macro is executed, the fields are unprotected and
I can't use the "Clean fields" option in the form toolbar. Is there any way
of reversing the process at the end of the macro?
Something like "Unprotect/Unlink/Send by mail/Link and protect document
again". The purpose is to restore the initial state of the fields/document,
keeping all the protections and fields' definitions.
I had the document protected with a password. I had to remove it, the code
you sent me gave an error "Invalid password". How can I keep the password
protection and only let this macro unprotect the document? Any parameter I
can use? ActiveDocument.Unprotect.Password."my password" or something like
that?...

Here is the current macro I'm using:

Sub sendmail()
With ActiveDocument
.Unprotect
.Fields.Unlink
End With

With Application.ActiveDocument.MailEnvelope
.Introduction = " "

With .Item
.Subject = "Doc title"
.To = "mymail@mymailserver"
.Send
End With
End With
End Sub
____________________________________________
 
C

Cindy M -WordMVP-

Hi Psantos,

Apparently Doug missed, this. He may be on vacation or something... I'm not
sure I can help, but I can keep the thread "alive" :)
I added that piece of code to my macro and it worked like a charm. With just
a slight problem: after the macro is executed, the fields are unprotected and
I can't use the "Clean fields" option in the form toolbar. Is there any way
of reversing the process at the end of the macro?
Something like "Unprotect/Unlink/Send by mail/Link and protect document
again". The purpose is to restore the initial state of the fields/document,
keeping all the protections and fields' definitions.
I had the document protected with a password. I had to remove it, the code
you sent me gave an error "Invalid password". How can I keep the password
protection and only let this macro unprotect the document? Any parameter I
can use? ActiveDocument.Unprotect.Password."my password" or something like
that?...
Once "Unlink" has been performed, there are no more fields to protect. Their
content has all been turned into plain text; that's what "Unlink" does.

It might be best to first save the document to file, before generating the
emails. Then you'll have it in its original state, with protection and all.
Here is the current macro I'm using:

Sub sendmail()
With ActiveDocument
.Unprotect
.Fields.Unlink
End With

With Application.ActiveDocument.MailEnvelope
.Introduction = " "

With .Item
.Subject = "Doc title"
.To = "mymail@mymailserver"
.Send
End With
End With
End Sub
____________________________________________

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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