Re: Creating a distribution list
- From: "Michael Bauer" <mib00@xxxxxxxxxxx>
- Date: Fri, 15 Jul 2005 11:22:47 +0200
Hi Kerstin,
please use this syntax or adding the Recipient:
myRecipients.Add "<" & Name & "> " & EMailAdr
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Kerstin Schiebel wrote:
> Hi,
>
> I use sometimes a little script for importing a text file for
> creating a distribution list.
> The syntax for the text file is email;name
> I get a DL where the display name is always the email address. Now
> emailaddress = display name
> I want to change the script that the name is always imported into the
> field "display name".
> I would be very lucky, if someone could give me a hint.
>
> Thank you very much.
> Kerstin
> -----------------------
> 'Öffnen der Datei
> Set f = fs.GetFile(Dateiname)
> Set ts = f.OpenAsTextStream(ForReading, TristateFalse)
>
>
> 'The MailItem is required to create the Recipients collection
> Set myMailItem = myOlApp.CreateItem(olMailItem)
> Set myRecipients = myMailItem.Recipients
>
> I = 1
> 'Lesen der einzelnen Datensätze und hinzufügen der EMail-Adressen
> 'ASCII-Datei in der Form: emailadresse; Name
> While ts.AtEndOfStream <> True
> zeile = ts.ReadLine
> Pos = InStr(1, zeile, ";")
> If Pos > 0 Then
> EMailAdr = Mid(zeile, 1, Pos - 1)
> myRecipients.Add EMailAdr
> Else
> MsgBox "Fehler in " & zeile
> End If
> Wend
>
> 'Create the Distribution List item
> Set myDistList = myFolder.Items.Add(olDistributionListItem)
> myDistList.DLName = InputBox("Bitte geben Sie den Namen der Liste
> ein: ", , "???")
>
> myDistList.AddMembers myRecipients
> myDistList.Save
> ---------------------
.
- Follow-Ups:
- Re: Creating a distribution list
- From: Kerstin Schiebel
- Re: Creating a distribution list
- References:
- Creating a distribution list
- From: Kerstin Schiebel
- Creating a distribution list
- Prev by Date: Creating a distribution list
- Next by Date: Re: Appointment Label Setting and Voting Buttons
- Previous by thread: Creating a distribution list
- Next by thread: Re: Creating a distribution list
- Index(es):