Adding Group

sandtech

Adding Group

Postby sandtech » Tue Oct 29, 2002 12:26 pm

hi
how to add group using vb code

sunpost
Posts: 438
Joined: Wed Sep 04, 2002 3:04 pm

Postby sunpost » Wed Oct 30, 2002 1:36 am

try this...

Code: Select all

Function CreateGroup(pstrGroupName As String, _
                 pstrDomain As String, _
                 pstrPostoffice As String, _
                 plngStatus As Long)

'CreateGroup("TheGroupName", "The.Domain","The_Postoffice",1)
'Status : 1 = enabled : 0 = disabled

Dim MyGroup As New MEAOPO.Group
Dim MyAddressmap As New MEAOAM.AddressMap

MyGroup.GroupName = pstrGroupName
MyGroup.GroupStatus = plngStatus
MyGroup.Postoffice = pstrPostoffice
MyGroup.RecipientAddress = pstrGroupName
MyGroup.AddGroup

MyAddressmap.Account = pstrPostoffice
MyAddressmap.DestinationAddress = "[SF:" & pstrPostoffice & "/" & pstrGroupName & "]"
MyAddressmap.SourceAddress = "[SMTP:" & pstrGroupName & "@" & pstrDomain & "]"
MyAddressmap.AddAddressMap

End Function

Function AddGroupMember(pstrAddress As String, _
                 pstrGroup As String, _
                 pstrPostoffice As String)
                 
'AddGroupMember("the@email.address","The_GroupName","The_Postoffice")

Dim MyGroupMember As New MEAOPO.GroupMember

MyGroupMember.Address = pstrAddress
MyGroupMember.Mailbox = pstrGroup
MyGroupMember.Postoffice = pstrPostoffice
MyGroupMember.AddGroupMember

End Function

Guest

Postby Guest » Wed Oct 30, 2002 7:58 am

thanks sunpost

the code u have posted for me is working

thanks once again..

Who is online

Users browsing this forum: No registered users and 4 guests