J
Jason Stegman
I have a macro that is intended to run on the current mail item. It loops
over the recipients conditionally processing each depending on the
Display Type. If the recipient is a Distribution List
(Recipient.DisplayType = 1 or 5) then the recipient is processed. If not,
it is left alone.
The problem is that this macro works on one computer and not another.
Both computers run on Win2000 and have Outlook 2000. The difference
between them is that one uses an Exchange Server Address List in Outlook
and the other is not connect to an Exchange Server. The macro works with
the Exchange Server Address List but not the stand-alone machine. CAN
ANYONE TELL ME HOW I CAN GET THIS MACRO TO WORK ON BOTH MACHINES? Do I
need a condition that depends on whether or not Outlook is connected to
an Exchange Server?
Below is a test version of the macro. I want the Debug.Print statement to
print 1 or 5 for Distribution List recipients.
Thanks in advance,
-Jason
Public Sub Test()
Dim mItem As Outlook.MailItem
Dim oldRcpnts As Outlook.Recipients
Dim Rcpnt As Outlook.Recipient, newRcpnt As Outlook.Recipient
Dim intRcpntIndex As Integer
Dim intRcpntDisplType As Integer
Set mItem = Application.ActiveInspector.CurrentItem
Set oldRcpnts = mItem.Recipients
intRcpntIndex = 0
For Each Rcpnt In oldRcpnts
intRcpntIndex = intRcpntIndex + 1
intRcpntDisplType = Rcpnt.DisplayType
Debug.Print intRcpntDisplType
Stop
Next
End Sub
over the recipients conditionally processing each depending on the
Display Type. If the recipient is a Distribution List
(Recipient.DisplayType = 1 or 5) then the recipient is processed. If not,
it is left alone.
The problem is that this macro works on one computer and not another.
Both computers run on Win2000 and have Outlook 2000. The difference
between them is that one uses an Exchange Server Address List in Outlook
and the other is not connect to an Exchange Server. The macro works with
the Exchange Server Address List but not the stand-alone machine. CAN
ANYONE TELL ME HOW I CAN GET THIS MACRO TO WORK ON BOTH MACHINES? Do I
need a condition that depends on whether or not Outlook is connected to
an Exchange Server?
Below is a test version of the macro. I want the Debug.Print statement to
print 1 or 5 for Distribution List recipients.
Thanks in advance,
-Jason
Public Sub Test()
Dim mItem As Outlook.MailItem
Dim oldRcpnts As Outlook.Recipients
Dim Rcpnt As Outlook.Recipient, newRcpnt As Outlook.Recipient
Dim intRcpntIndex As Integer
Dim intRcpntDisplType As Integer
Set mItem = Application.ActiveInspector.CurrentItem
Set oldRcpnts = mItem.Recipients
intRcpntIndex = 0
For Each Rcpnt In oldRcpnts
intRcpntIndex = intRcpntIndex + 1
intRcpntDisplType = Rcpnt.DisplayType
Debug.Print intRcpntDisplType
Stop
Next
End Sub