RE: VBscript-CDO and adding SMTP address to user

  • From: "Malcolm K Smith" <malcolm.smith@xxxxxxxxxxxxxx>
  • To: "[ExchangeList]" <exchangelist@xxxxxxxxxxxxx>
  • Date: Mon, 22 Apr 2002 12:12:24 +0100

Joe
 
If you select the object in code which you wish to have the extra
address as a MAPI object then what you can do is this:
 
  with OMailRecipient
   .SMTPEmail = "  <mailto:malcolm.smith@xxxxxxxxxxxxxx>
malcolm.smith@xxxxxxxxxxxxxx"
  end with
 
This changes the SMTP default address.
 
To add an extra address to the object you have to extend the
.ProxyAddresses property.
 
 
This is held as an array of Variant type and all you do is to add an
extra element to the array and then save the array to the object.   I am
doing this right this very moment as I am writing a MajorDomo type
mailing list thing for Exchange 2000 and I am creating new public
folders with e-mail enabled.
 
Anyway, here is a routine which may be useful to add an address to the
ProxyAddresses property of the object.
 
If you have any questions then please shout.
 
Malc
   <http://www.dragondrop.com> www.dragondrop.com
 
 
Private Sub AddAddressToProxyAddresses(oMailRecipient As
cdoexm.IMailRecipient, sAddress As String)
 
  Dim vProxyAddresses As Variant
  Dim nProxyAddresses As Long
  Dim nProxyAddress As Long
  Dim bIsFound As Boolean
  
  
  bIsFound = False
 
  vProxyAddresses = oMailRecipient.ProxyAddresses
  nProxyAddresses = UBound(vProxyAddresses)
  nProxyAddress = 0
  
  Do While nProxyAddress <= nProxyAddresses
    If vProxyAddresses(nProxyAddress) = sAddress Then
      bIsFound = True
      Exit Do
    End If
    nProxyAddress = nProxyAddress + 1
  Loop
  
  If Not bIsFound Then
    ReDim Preserve vProxyAddresses(nProxyAddresses + 1)
    vProxyAddresses(nProxyAddresses + 1) = sAddress
    oMailRecipient.ProxyAddresses = vProxyAddresses
  End If
 
End Sub
 

-----Original Message-----
From: Sargent Joey E [mailto:joey@xxxxxxxxxxxxxxx]
Sent: 21 April 2002 05:18
To: [ExchangeList]
Subject: [exchangelist] VBscript-CDO and adding SMTP address to user


http://www.MSExchange.org/


I want to add a secondary and a default address to the various users
mailboxes via a VB script and CDO.  I have the mailbox creation working,
but cannot figure out the syntax for adding a secondary or default SMTP
email address.
 
Thanks,
Joe S.

 

------------------------------------------------------
You are currently subscribed to this MSExchange.org Discussion List as:
malcolm.smith@xxxxxxxxxxxxxx
To unsubscribe send a blank email to
$subst('Email.Unsub') 

Other related posts: