Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
Hi Friends and Experts,
I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
Will this help?
Public Function ReturnNetworkName() As String 'RETURNS NETWORK LOGIN ID OF CURRENT USER ReturnNetworkName = Environ("UserName") End Function AND: Public Function ReturnComputerName() As String 'RETURNS COMPUTER NUMBER USER IS ON ReturnComputerName = Environ("ComputerName") End Function Regards, Ryan--- -- RyGuy "Alok Joshi" wrote: Hi Friends and Experts, I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
It might be illegal but I know it is unethical to hack into a users system to
retrieve personal information. So, if I was planning that type of set up, I would try to make part of the log in also ask for their name and email address. You have to be careful how you obtain information about users. I expect to see new federal laws passed in the near future regarding such matters because of the increases in identity theft and invasion of privacy for things like shopping habits, internet contacts, etc. While your intentions are honorable, your methods must also be. "Alok Joshi" wrote: Hi Friends and Experts, I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
Does your application send emails from the different users? If so, why does
it need their email address? -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Alok Joshi" wrote: Hi Friends and Experts, I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
Thanks to ryguy7272, JLGWhiz and yourself for responding.
My application is an internal application for an organization where when a user completes a task in the application, sends out an e-mail to other users of the application that such-and-such task has been completed. There are over 50 such users. I have already built up the nt login names of the users - say jsmith, dbarney etc. These are maintained in an access database in a shared drive on the intranet. What I need to do is to somehow find out the full name - programly John Smith, David Barney etc. and also the e-mail addresses of the users so that the application can send out the e-mails. Thanks again. "Barb Reinhardt" wrote: Does your application send emails from the different users? If so, why does it need their email address? -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Alok Joshi" wrote: Hi Friends and Experts, I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
Ahhh! More information is revealed. If the records are in Access, you may
want to just leave them in Access and use that app. to send emails through Outlook. Run this code below (make appropriate modifications): Sub SendMessages(Optional AttachmentPath) Dim MyDB As DAO.Database Dim MyRS As DAO.Recordset Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment Dim TheAddress As String Set MyDB = CurrentDb Set MyRS = MyDB.OpenRecordset("tblMailingList") MyRS.MoveFirst ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") Do Until MyRS.EOF ' Create the e-mail message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) TheAddress = MyRS![EmailAddress] With objOutlookMsg ' Add the To recipients to the e-mail message. Set objOutlookRecip = .Recipients.Add(TheAddress) objOutlookRecip.Type = olTo ' Add the Cc recipients to the e-mail message. If (IsNull(Forms!frmMail!CCAddress)) Then Else Set objOutlookRecip = .Recipients.Add(Forms!frmMail!CCAddress) objOutlookRecip.Type = olCC End If ' Set the Subject, the Body, and the Importance of the e-mail message. ..Subject = Forms!frmMail!Subject ..Body = Forms!frmMail!MainText ..Importance = olImportanceHigh 'High importance ' Add attachments to the message. With Application.FileSearch .LookIn = Forms!frmMail!Att .FileName = "*.*" .Execute For i = 1 To .FoundFiles.Count objOutlookMsg.Attachments.Add .FoundFiles(i) Next i End With ' Resolve the name of each Recipient. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve If Not objOutlookRecip.Resolve Then objOutlookMsg.Display End If Next ..Send End With MyRS.MoveNext Loop Set objOutlookMsg = Nothing Set objOutlook = Nothing End Sub Finally, install and run this (free and very practical) utility: http://www.snapfiles.com/get/clickyes.html Regards, Ryan--- -- RyGuy "Alok Joshi" wrote: Thanks to ryguy7272, JLGWhiz and yourself for responding. My application is an internal application for an organization where when a user completes a task in the application, sends out an e-mail to other users of the application that such-and-such task has been completed. There are over 50 such users. I have already built up the nt login names of the users - say jsmith, dbarney etc. These are maintained in an access database in a shared drive on the intranet. What I need to do is to somehow find out the full name - programly John Smith, David Barney etc. and also the e-mail addresses of the users so that the application can send out the e-mails. Thanks again. "Barb Reinhardt" wrote: Does your application send emails from the different users? If so, why does it need their email address? -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Alok Joshi" wrote: Hi Friends and Experts, I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
It seemed to me that the OP was looking for a way to programmatically obtain
the full name and email of a user who logged onto the net. The legal way to do that is to have authorized net users to provide the data and build a file that the data can be retrieved from when needed. I would not want to provide code that shows how to detect a user's email address progammatically by accessing their mail service. While members on a network may well already have access to the addresses, it is the publishing of the method to obtain it that I question. Maybe I am just too cautious because I have been victimized by identity theft. "ryguy7272" wrote: Ahhh! More information is revealed. If the records are in Access, you may want to just leave them in Access and use that app. to send emails through Outlook. Run this code below (make appropriate modifications): Sub SendMessages(Optional AttachmentPath) Dim MyDB As DAO.Database Dim MyRS As DAO.Recordset Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment Dim TheAddress As String Set MyDB = CurrentDb Set MyRS = MyDB.OpenRecordset("tblMailingList") MyRS.MoveFirst ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") Do Until MyRS.EOF ' Create the e-mail message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) TheAddress = MyRS![EmailAddress] With objOutlookMsg ' Add the To recipients to the e-mail message. Set objOutlookRecip = .Recipients.Add(TheAddress) objOutlookRecip.Type = olTo ' Add the Cc recipients to the e-mail message. If (IsNull(Forms!frmMail!CCAddress)) Then Else Set objOutlookRecip = .Recipients.Add(Forms!frmMail!CCAddress) objOutlookRecip.Type = olCC End If ' Set the Subject, the Body, and the Importance of the e-mail message. .Subject = Forms!frmMail!Subject .Body = Forms!frmMail!MainText .Importance = olImportanceHigh 'High importance ' Add attachments to the message. With Application.FileSearch .LookIn = Forms!frmMail!Att .FileName = "*.*" .Execute For i = 1 To .FoundFiles.Count objOutlookMsg.Attachments.Add .FoundFiles(i) Next i End With ' Resolve the name of each Recipient. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve If Not objOutlookRecip.Resolve Then objOutlookMsg.Display End If Next .Send End With MyRS.MoveNext Loop Set objOutlookMsg = Nothing Set objOutlook = Nothing End Sub Finally, install and run this (free and very practical) utility: http://www.snapfiles.com/get/clickyes.html Regards, Ryan--- -- RyGuy "Alok Joshi" wrote: Thanks to ryguy7272, JLGWhiz and yourself for responding. My application is an internal application for an organization where when a user completes a task in the application, sends out an e-mail to other users of the application that such-and-such task has been completed. There are over 50 such users. I have already built up the nt login names of the users - say jsmith, dbarney etc. These are maintained in an access database in a shared drive on the intranet. What I need to do is to somehow find out the full name - programly John Smith, David Barney etc. and also the e-mail addresses of the users so that the application can send out the e-mails. Thanks again. "Barb Reinhardt" wrote: Does your application send emails from the different users? If so, why does it need their email address? -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Alok Joshi" wrote: Hi Friends and Experts, I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving email addresses from nt logins
Thanks for your very detailed response.
As JLGWhiz has mentioned I am looking for a way to find out the e-mail addresses of other members of the same organization (something they can easily get manually by looking up the address book in Outlook). I was just wonding if one can get these addresses programmatically if one just knew the NT Login of the individual users. Thanks again to you and JLGWhiz for your responses. "ryguy7272" wrote: Ahhh! More information is revealed. If the records are in Access, you may want to just leave them in Access and use that app. to send emails through Outlook. Run this code below (make appropriate modifications): Sub SendMessages(Optional AttachmentPath) Dim MyDB As DAO.Database Dim MyRS As DAO.Recordset Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment Dim TheAddress As String Set MyDB = CurrentDb Set MyRS = MyDB.OpenRecordset("tblMailingList") MyRS.MoveFirst ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") Do Until MyRS.EOF ' Create the e-mail message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) TheAddress = MyRS![EmailAddress] With objOutlookMsg ' Add the To recipients to the e-mail message. Set objOutlookRecip = .Recipients.Add(TheAddress) objOutlookRecip.Type = olTo ' Add the Cc recipients to the e-mail message. If (IsNull(Forms!frmMail!CCAddress)) Then Else Set objOutlookRecip = .Recipients.Add(Forms!frmMail!CCAddress) objOutlookRecip.Type = olCC End If ' Set the Subject, the Body, and the Importance of the e-mail message. .Subject = Forms!frmMail!Subject .Body = Forms!frmMail!MainText .Importance = olImportanceHigh 'High importance ' Add attachments to the message. With Application.FileSearch .LookIn = Forms!frmMail!Att .FileName = "*.*" .Execute For i = 1 To .FoundFiles.Count objOutlookMsg.Attachments.Add .FoundFiles(i) Next i End With ' Resolve the name of each Recipient. For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve If Not objOutlookRecip.Resolve Then objOutlookMsg.Display End If Next .Send End With MyRS.MoveNext Loop Set objOutlookMsg = Nothing Set objOutlook = Nothing End Sub Finally, install and run this (free and very practical) utility: http://www.snapfiles.com/get/clickyes.html Regards, Ryan--- -- RyGuy "Alok Joshi" wrote: Thanks to ryguy7272, JLGWhiz and yourself for responding. My application is an internal application for an organization where when a user completes a task in the application, sends out an e-mail to other users of the application that such-and-such task has been completed. There are over 50 such users. I have already built up the nt login names of the users - say jsmith, dbarney etc. These are maintained in an access database in a shared drive on the intranet. What I need to do is to somehow find out the full name - programly John Smith, David Barney etc. and also the e-mail addresses of the users so that the application can send out the e-mails. Thanks again. "Barb Reinhardt" wrote: Does your application send emails from the different users? If so, why does it need their email address? -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Alok Joshi" wrote: Hi Friends and Experts, I have an Excel application in which I have already got a table of the nt logins of the valid users which I use to validate the user. However, I would like the application to figure out the users full name and internal e-mail address. This is becuase the application is expected to automatically send e-mails etc. Is there a way I can do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Macro how to create email link for the email addresses in aRange or Selection | Excel Worksheet Functions | |||
can I copy a column of email addresses, paste into email address? | New Users to Excel | |||
Email addresses in Excel need to format for mass email | Excel Worksheet Functions | |||
Transfer Email addresses from spreadsheet to email address book | Excel Discussion (Misc queries) | |||
send email with email addresses in a range of cells | Excel Programming |