PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Retreiving the senders email address
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Retreiving the senders email address
![]() |
Retreiving the senders email address |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Dear folks,
I am creating a program in VB .net to access the email address of the sender from the microsoft outlook folder. I can access the subject line when I write the following piece of code, However I don't know how to access the email address property of the person sending the mail? I tried "sendername" property , but didnt' work! Any suggestions would be appreciated. My code is below , for retreiving the subject. cheers, Ranjan Dim Objapp = CreateObject("outlook.application") Dim objns = Objapp.GetNamespace("MAPI") 'Dim objfolder = objns.PickFolder Dim strName As String Dim objselection = Objapp.activeExplorer.selection Dim objItem As Object For Each objItem In objselection TextBox1.Text = objItem.subject loop |
|
|
|
#2 |
|
Guest
Posts: n/a
|
See http://www.outlookcode.com/d/code/getsenderaddy.htm
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Ranjan as usual" <anonymous@discussions.microsoft.com> wrote in message news:1EE63F8E-CEBB-4C3B-A689-1690277B665C@microsoft.com... > Dear folks, > I am creating a program in VB .net to access the email address of the sender from the microsoft outlook folder. I can access the subject line when I write the following piece of code, However I don't know how to access the email address property of the person sending the mail? I tried "sendername" property , but didnt' work! Any suggestions would be appreciated. My code is below , for retreiving the subject. > > cheers, > > Ranjan > > > Dim Objapp = CreateObject("outlook.application") > Dim objns = Objapp.GetNamespace("MAPI") > 'Dim objfolder = objns.PickFolder > Dim strName As String > > Dim objselection = Objapp.activeExplorer.selection > Dim objItem As Object > > > For Each objItem In objselection > > TextBox1.Text = objItem.subject > > loop > > > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
In Outlook 2003, you can use the MailItem.SenderEmailAddress, but note that
it's subject to security prompts. In earlier versions, there is no Outlook property that returns the sender's email address. You can either use CDO (or Redemption to avoid security prompts -- http://www.dimastr.com/redemption/) to get the From address or use Outlook to get the Reply To address. Sample code at http://www.outlookcode.com/d/code/getsenderaddy.htm -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Ranjan as usual" <anonymous@discussions.microsoft.com> wrote in message news:1EE63F8E-CEBB-4C3B-A689-1690277B665C@microsoft.com... > Dear folks, > I am creating a program in VB .net to access the email address of the sender from the microsoft outlook folder. I can access the subject line when I write the following piece of code, However I don't know how to access the email address property of the person sending the mail? I tried "sendername" property , but didnt' work! Any suggestions would be appreciated. My code is below , for retreiving the subject. > > cheers, > > Ranjan > > > Dim Objapp = CreateObject("outlook.application") > Dim objns = Objapp.GetNamespace("MAPI") > 'Dim objfolder = objns.PickFolder > Dim strName As String > > Dim objselection = Objapp.activeExplorer.selection > Dim objItem As Object > > > For Each objItem In objselection > > TextBox1.Text = objItem.subject > > loop > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

