Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Stella Stella is offline
external usenet poster
 
Posts: 16
Default Why doesn't Word show dropdown box results in form when emailed?

I have designed a form for salespeople which is simple to use and want them
to be able to click on 'SEND TO' (via Outlook) from Word (2003)so that they
can send the results from there rather than attaching as a Word document.
However, if they do this the answers they've selected in the drop down boxes
do not show. If they attach as a Word doc it is perfect. Would be grateful
if anyone knows why or how to fix..
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Why doesn't Word show dropdown box results in form when emailed?

The formatting requirements of HTML e-mail and word document are different;
however if it is only the results of the form fields that you are interested
in, it is simple enough to e-mail those in the form of (say) a comma
delimited file. The following macro will extract the content of each field
(check boxes copy as 0 or 1) and write it into a throw away Word document as
a comma delimited file. When all the fields are extracted, the macro then
e-mails the resulting comma delimited file to the e-mail address indicated.

You will need to add the Microsoft Outlook Object Library to vba Tools
References for this to work.

I have set the macro to display the message. If you want to simply send it,
change the line .Display to .Send

Sub ExtractData()
Dim oFld As FormFields
Dim sText As String
Dim i As Long
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
Dim dDataDoc As Word.Document
Dim dSource As Word.Document
Dim objDoc As Word.Document
Set dSource = ActiveDocument
Set dDataDoc = Documents.Add
Set oFld = dSource.FormFields
Application.ScreenUpdating = False
For i = 1 To oFld.Count
sText = oFld(i).Result
dDataDoc.Activate
If i 1 Then Selection.TypeText ","
Selection.TypeText sText
If i = oFld.Count Then Selection.TypeParagraph
dSource.Activate
Next i
dDataDoc.Range.Copy

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")

'Outlook wasn't running, start it from code
If Err 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)
Set objDoc = oItem.GetInspector.WordEditor
With oItem
.To = "
.Subject = "Data Return"
objDoc.Range.Paste
.Display
End With

'Clean up
Application.ScreenUpdating = True
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub

http://www.gmayor.com/installing_macro.htm

Stella wrote:
I have designed a form for salespeople which is simple to use and
want them to be able to click on 'SEND TO' (via Outlook) from Word
(2003)so that they can send the results from there rather than
attaching as a Word document. However, if they do this the answers
they've selected in the drop down boxes do not show. If they attach
as a Word doc it is perfect. Would be grateful if anyone knows why
or how to fix..



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does Word 2007 NOT show Track Changes in emailed documents Peduardus Microsoft Word Help 2 November 6th 07 07:10 PM
How do I show results of a calculated field on a protected form? Roy Lehmann New Users 2 February 7th 07 12:02 PM
inserting text from the results of a dropdown box pmburrow Mailmerge 1 March 16th 06 05:02 AM
How do I get Word to open so that fields show results, not code? Zorcon Microsoft Word Help 1 November 27th 05 03:10 AM
clipart doesn't show up in results box - only icon to click on Nancy Microsoft Word Help 0 May 3rd 05 02:31 PM


All times are GMT +1. The time now is 04:16 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"