Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieving user profile from exchange server

Status
Not open for further replies.

sardevs

Programmer
Mar 4, 2003
3
0
0
US
Hi All
I have to send email from a VB application to all our company employees. I just have employee number of them.
My Network admin team maintained employee number in the "last name" property of the profile under the "NAME" section. So, i used outlook application object to send mail to the employee by giving the TO address as employeeID (which was maintained in "last name" Property). When sending outlook was able to resolve the employee number and everything went ok.

Now,
The employee number field itself created in the exclusively and which is not in the name tab. so, my application is nw failing to resolve.

My question is
1.How to retrieve the email address of all the employees from a exchanges server?

My previous coding is....

Dim oObj As Outlook.Application
Dim omess As Outlook.MailItem
Dim oNMs As Outlook.NameSpace
Dim myFolder As Object
Dim strEmployeeNumber
On Error GoTo Errorhandler
Set oObj = New Outlook.Application
Set omess = oObj.CreateItem(olMailItem)
strEmployeeNumber = "11865" ' Hardcoded
omess.To = Trim(strEmployeeNumber) + ";"
omess.Subject = "Your PaySlip for the month of " & SalaryMonth
omess.HTMLBody = "pay slip information"
omess.Send


Now how do i do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top