![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 03:50 AM |
Outlook Express send error 554 'recipient rejected by server' | Maddydoggy | Outlook Express | 9 | November 4th 06 04:03 PM |
Expired messages are deleted by the recipient OL or Exchange? | Lucas Campos | Outlook - General Queries | 4 | October 30th 06 08:43 PM |
Importing External Email Address To Exchange Server | Lisa AGA | Outlook - Using Contacts | 1 | October 24th 06 12:00 AM |
!!HELP!!! Cannot connect to Exchange Server from a RDP, ICA session or server local machine | AllenM | Outlook - General Queries | 0 | May 11th 06 11:14 PM |