A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Recipient.Address in Exchange Server



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 7th 06, 11:11 PM posted to microsoft.public.outlook.program_vba
Joel
external usenet poster
 
Posts: 48
Default Recipient.Address in Exchange Server

TIA:

In earlier email I have following code:

Sub Send_Attachment_Messages()

Dim oFolder As Outlook.MAPIFolder
Dim Items As Outlook.Items
Dim objItem As MailItem
Dim Recips As Recipients
Dim Recip As Recipient

Set Items =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderOutbox).Items
For Each objItem In Items
Set Recips = objItem.Recipients
For Each Recip In Recips

If Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\115.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\116.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\118.xls")
objItem.Send


End If
Next
Next
End Sub

When I run code in Outlook on non Exchange Server compute all is fine.

When I run code in Outlook that is networked with Excange Server, it doen't.
Upon debug the Reciepient.Address value is something like
"/o=Company/ou/SUBCOMPANY/cn=Main Office=JonesB" certainly not .
When I type the value as "o/=Company..." in the If test in my code, it still
doen't match the actual emails and thus nothing gets attached.

One other fact..the email is generated from Word Mail Merge. I can see the
values of EMail used by Word which is consistent with the data above
"o/Company..." but in Step Mode of Outlook Recip.Address appears as CAPS but
it is not that way in the Word Merge Data Table.

Any ideas of what my code needs to be to match the EMail address as seen in
the Outbox by my code. ie Recip.Address = "/o=Company/ou/SUBCOMPANY/cn=Main
Office=JonesB" doen't work even though this is the value shown in Step Mode.

Thanks very much,

Joel
Ads
  #2  
Old December 8th 06, 12:10 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Recipient.Address in Exchange Server

Well, if the comparison fails, you can output the values, e.g. using MsgBox,
right?
First of all, e-mail adddress comparison should be cause insensitive.
Secondly, what you are seeing is a perfectly valid EX type (as opposed to
SMTP) address.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Joel" wrote in message
...
TIA:

In earlier email I have following code:

Sub Send_Attachment_Messages()

Dim oFolder As Outlook.MAPIFolder
Dim Items As Outlook.Items
Dim objItem As MailItem
Dim Recips As Recipients
Dim Recip As Recipient

Set Items =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderOutbox).Items
For Each objItem In Items
Set Recips = objItem.Recipients
For Each Recip In Recips

If Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\115.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\116.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\118.xls")
objItem.Send


End If
Next
Next
End Sub

When I run code in Outlook on non Exchange Server compute all is fine.

When I run code in Outlook that is networked with Excange Server, it
doen't.
Upon debug the Reciepient.Address value is something like
"/o=Company/ou/SUBCOMPANY/cn=Main Office=JonesB" certainly not
.
When I type the value as "o/=Company..." in the If test in my code, it
still
doen't match the actual emails and thus nothing gets attached.

One other fact..the email is generated from Word Mail Merge. I can see
the
values of EMail used by Word which is consistent with the data above
"o/Company..." but in Step Mode of Outlook Recip.Address appears as CAPS
but
it is not that way in the Word Merge Data Table.

Any ideas of what my code needs to be to match the EMail address as seen
in
the Outbox by my code. ie Recip.Address =
"/o=Company/ou/SUBCOMPANY/cn=Main
Office=JonesB" doen't work even though this is the value shown in Step
Mode.

Thanks very much,

Joel



  #3  
Old December 8th 06, 12:23 AM posted to microsoft.public.outlook.program_vba
Joel
external usenet poster
 
Posts: 48
Default Recipient.Address in Exchange Server

Dmitry:

Yes, I can output in msgbox...I might also try LCase of Address to get out
of case sensitivity. OK??

Joel

"Dmitry Streblechenko" wrote:

Well, if the comparison fails, you can output the values, e.g. using MsgBox,
right?
First of all, e-mail adddress comparison should be cause insensitive.
Secondly, what you are seeing is a perfectly valid EX type (as opposed to
SMTP) address.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Joel" wrote in message
...
TIA:

In earlier email I have following code:

Sub Send_Attachment_Messages()

Dim oFolder As Outlook.MAPIFolder
Dim Items As Outlook.Items
Dim objItem As MailItem
Dim Recips As Recipients
Dim Recip As Recipient

Set Items =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderOutbox).Items
For Each objItem In Items
Set Recips = objItem.Recipients
For Each Recip In Recips

If Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\115.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\116.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\118.xls")
objItem.Send


End If
Next
Next
End Sub

When I run code in Outlook on non Exchange Server compute all is fine.

When I run code in Outlook that is networked with Excange Server, it
doen't.
Upon debug the Reciepient.Address value is something like
"/o=Company/ou/SUBCOMPANY/cn=Main Office=JonesB" certainly not
.
When I type the value as "o/=Company..." in the If test in my code, it
still
doen't match the actual emails and thus nothing gets attached.

One other fact..the email is generated from Word Mail Merge. I can see
the
values of EMail used by Word which is consistent with the data above
"o/Company..." but in Step Mode of Outlook Recip.Address appears as CAPS
but
it is not that way in the Word Merge Data Table.

Any ideas of what my code needs to be to match the EMail address as seen
in
the Outbox by my code. ie Recip.Address =
"/o=Company/ou/SUBCOMPANY/cn=Main
Office=JonesB" doen't work even though this is the value shown in Step
Mode.

Thanks very much,

Joel




  #4  
Old December 8th 06, 04:52 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Recipient.Address in Exchange Server

Yes, that should work.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Joel" wrote in message
...
Dmitry:

Yes, I can output in msgbox...I might also try LCase of Address to get out
of case sensitivity. OK??

Joel

"Dmitry Streblechenko" wrote:

Well, if the comparison fails, you can output the values, e.g. using
MsgBox,
right?
First of all, e-mail adddress comparison should be cause insensitive.
Secondly, what you are seeing is a perfectly valid EX type (as opposed to
SMTP) address.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Joel" wrote in message
...
TIA:

In earlier email I have following code:

Sub Send_Attachment_Messages()

Dim oFolder As Outlook.MAPIFolder
Dim Items As Outlook.Items
Dim objItem As MailItem
Dim Recips As Recipients
Dim Recip As Recipient

Set Items =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderOutbox).Items
For Each objItem In Items
Set Recips = objItem.Recipients
For Each Recip In Recips

If Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\115.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\116.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\118.xls")
objItem.Send


End If
Next
Next
End Sub

When I run code in Outlook on non Exchange Server compute all is fine.

When I run code in Outlook that is networked with Excange Server, it
doen't.
Upon debug the Reciepient.Address value is something like
"/o=Company/ou/SUBCOMPANY/cn=Main Office=JonesB" certainly not
.
When I type the value as "o/=Company..." in the If test in my code, it
still
doen't match the actual emails and thus nothing gets attached.

One other fact..the email is generated from Word Mail Merge. I can see
the
values of EMail used by Word which is consistent with the data above
"o/Company..." but in Step Mode of Outlook Recip.Address appears as
CAPS
but
it is not that way in the Word Merge Data Table.

Any ideas of what my code needs to be to match the EMail address as
seen
in
the Outbox by my code. ie Recip.Address =
"/o=Company/ou/SUBCOMPANY/cn=Main
Office=JonesB" doen't work even though this is the value shown in Step
Mode.

Thanks very much,

Joel






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update address book automatically FROM EXCHANGE SERVER gchandrujs via OfficeKB.com Outlook - Using Contacts 2 November 10th 06 02:50 AM
Outlook Express send error 554 'recipient rejected by server' Maddydoggy Outlook Express 9 November 4th 06 03:03 PM
Expired messages are deleted by the recipient OL or Exchange? Lucas Campos Outlook - General Queries 4 October 30th 06 07:43 PM
Importing External Email Address To Exchange Server Lisa AGA Outlook - Using Contacts 1 October 23rd 06 11:00 PM
!!HELP!!! Cannot connect to Exchange Server from a RDP, ICA session or server local machine AllenM Outlook - General Queries 0 May 11th 06 10:14 PM


All times are GMT +1. The time now is 07:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.