473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Outlook object

I am using the Outlook.MailItem object to extract fields such as
ReceivedBy, SenderName and Subject from emails, but it seems like there
is no way to get at the actual received by email address and sent by
email address, I can only get at the actual name of the sender and
recipient.

Is there any other way to get these email addresses?

*** Sent via Developersdex http://www.developersdex.com ***
May 10 '07 #1
5 2573
On May 10, 12:13 pm, Mike P <mike.p...@gmail.comwrote:
I am using the Outlook.MailItem object to extract fields such as
ReceivedBy, SenderName and Subject from emails, but it seems like there
is no way to get at the actual received by email address and sent by
email address, I can only get at the actual name of the sender and
recipient.

Is there any other way to get these email addresses?
Did you look at the Recipients collection on MailItem, as well as
SenderEmailAddress?

May 10 '07 #2
I can't find SenderEmailAddress in intellisense for this object...are
you sure you can get this?
*** Sent via Developersdex http://www.developersdex.com ***
May 11 '07 #3
SenderEmailAddress is only available in Outlook 11...is there anything
similar I can use in Outlook 10?

*** Sent via Developersdex http://www.developersdex.com ***
May 11 '07 #4
I have found this code in VB to get the ReplyTo address. Can anybody
tell me how to declare the Reply object?

Set objReply = objMsg.Reply
On Error Resume Next
Set objRecip = objReply.Recipients.Item(1)
If Err = 0 Then
' address will be in Name or Address depending
' on sending application and type of address
strAddress = objRecip.Address
If strAddress = "" Then
strAddress = objRecip.Name
End If
ElseIf Err = 287 Then
'handle possible security patch error
strAddress = ""
MsgBox "The Outlook E-mail Security Patch is " & _
"apparently installed on this machine. " & _
"You must response Yes to the prompt about " & _
"accessing e-mail addresses if you want to " & _
"get the Reply To address.", vbExclamation, _
"GetReplyToAddress"
End If


*** Sent via Developersdex http://www.developersdex.com ***
May 11 '07 #5
It looks like it's the reply to an Outlook mail item, which would be another
mail item, so try Outlook.mailItem if you've included the Outlook reference.
If that doesn't work you can dim as Object.
Paul Shapiro

"Mike P" <mi*******@gmail.comwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
>I have found this code in VB to get the ReplyTo address. Can anybody
tell me how to declare the Reply object?

Set objReply = objMsg.Reply
On Error Resume Next
Set objRecip = objReply.Recipients.Item(1)
If Err = 0 Then
' address will be in Name or Address depending
' on sending application and type of address
strAddress = objRecip.Address
If strAddress = "" Then
strAddress = objRecip.Name
End If
ElseIf Err = 287 Then
'handle possible security patch error
strAddress = ""
MsgBox "The Outlook E-mail Security Patch is " & _
"apparently installed on this machine. " & _
"You must response Yes to the prompt about " & _
"accessing e-mail addresses if you want to " & _
"get the Reply To address.", vbExclamation, _
"GetReplyToAddress"
End If

May 11 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: John | last post by:
Hi When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am...
2
by: John | last post by:
Hi I am trying to find the way to create an email in outlook. I am using the code given at the end. It works fine the first time but calling the code second time gives the following error; ...
9
by: Srinivas | last post by:
hi all how to access the outlook user profiles through VB.net any help.... thanks in advanc Srinivas
8
by: Li Pang | last post by:
Hi, I used following codes to pass a message item from CDO to Outlook. They worked fine when I used outlook 2000, but get an error of "Specified cast is not valid." when I used Outlook 2003....
3
by: wizzbangca | last post by:
Hi everyone. Having problems with a utility I am writing for work. The previous IT Director thoughtfully allowed 3 (2000, xp, 2003) versions of outlook to be installed rather than 1. Now I need...
4
by: Pieter | last post by:
Hi, On the pc of one of my clients (W2000, Office 2003) I'm getting sometimes an exception when moving (Move) a MailItem to an Outlook-Folder: The RPC server is not available. (Exception from...
2
by: Pieter | last post by:
Hi, I'm using a thight integration with Outlook 2003 (with an Exchange server) in my VB.NET (2005) application. Until now I'm using the Outlook Object Model, but it appears to be very slow, and...
7
by: Dean Spencer | last post by:
Can anyone help? I am importing Emails from Outlook using the following code: Public Function ScanInbox(SubjectLine As String) Dim TempRst As Recordset Dim OlApp As Outlook.Application Dim...
5
by: fniles | last post by:
I am using VB.NET 2005. I created a project using the Microsoft Outlook 8.0 Object Library (Object Model) in my previous machine. Now that I have a new machine, when I try to compile that program...
1
by: Sylfelin | last post by:
Hello, If I use Microsoft Outlook 12.0 Object Library (Outlook 2007) COM Object in my application, the custommer must have the outlook 2007 on his computer ? But if i use Microsoft Outlook...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.