From: iris on
Hi everybody,

I have created a word userform (in word 2007) and I need to send the data
from the userform to a list of employees using the outlook namelist (contact
list).

there are 2 possibilities to consider:
1. opening the contact list in a stand alone computer
2. opening the contact list with activex control (for a big organization).

can someone tell me how to do that please?
From: Graham Mayor on
If you are continually sending this data to the same bunch of employees, you
could set up a distribution list. Write the form data to a new document and
then call the following macro to send the document as a message to the
members of the distribution list using a macro such as the following. By
using the BCC function the recipients will not see who else you have sent
the message to.

Sub Send_As_HTML_EMail()
Dim bStarted As Boolean
Dim oOutlookApp As Object
Dim oItem As Object
Dim strList as String
Dim oRng As Range

strList = "Distribution List Name"

Set oRng = ActiveDocument.Range
oRng.Copy
'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn't running, start it from code
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(0)
With oItem
.BodyFormat = olFormatHTML
Set objDoc = .GetInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.Paste
.to = ""
.BCC = strList
.Subject = "Form Data"
.Display
'or
'.Send
End With
If bStarted Then
'If we started Outlook from code, then close it
oOutlookApp.Quit
End If
'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub


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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"iris" <iris(a)discussions.microsoft.com> wrote in message
news:7D74590B-05FF-4867-AEDE-03A9D8E9AD32(a)microsoft.com...
> Hi everybody,
>
> I have created a word userform (in word 2007) and I need to send the data
> from the userform to a list of employees using the outlook namelist
> (contact
> list).
>
> there are 2 possibilities to consider:
> 1. opening the contact list in a stand alone computer
> 2. opening the contact list with activex control (for a big organization).
>
> can someone tell me how to do that please?


 | 
Pages: 1
Prev: Add-InTemplates
Next: Unable to add table