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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

ActiveInspector Recipient's members (Distribution List) not accessible via Word VBA - Redemption



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 10th 06, 02:13 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 23
Default ActiveInspector Recipient's members (Distribution List) not accessible via Word VBA - Redemption

Hello all,

I am trying to get the Recipient (Distribution List) from an
ActiveInspector. The code that I am using is below. I am trying to
retrieve the recipient from MS Word VBA. If I put the same code in
Outlook VBA I am able to access the Members of the distribution list.
Now what gets interesting is when I put the code in Word VBA and get a
reference to ActiveInspector.CurrentItem into a SafeMailItem, for some
reason the Recipient's - AddressEntry - Members no longer seem to
be available.

I need to access the distribution list from the recipient of the
ActiveInspector from Word. What am I doing wrong? Is redemption loosing
the recipient properties for some reason?

Even for a normal recipient I am not able to access the PR_DISPLAY_NAME
and PR_SURNAME fields for the address entries when I try to access
these from Word VBA.

I am not able to access the AddressEntry.members.count or any other
properties of AddressEntry.

I would appreciate the help.

Thanks,
neil goundar

************************************************** ************************************************** ****

Public Sub GetRecipientName()
Dim oMail As Outlook.MailItem

Dim sfeMail 'As Redemption.SafeMailItem

Dim intType As Integer

Dim golapp As Outlook.Application
Dim rec

Dim aEntry, myAddressEntry

Set golapp = CreateObject("Outlook.Application", "localhost")

Set oMail = golapp.ActiveInspector.CurrentItem

Set sfeMail = CreateObject("sndRedemption.sndSafeMailItem")

Set sfeMail.Item = oMail

sfeMail.Save

Set rec = sfeMail.Recipients(1)

Debug.Print rec.Name
Debug.Print rec.DisplayType

Set aEntry = rec.AddressEntry

For i = 1 To aEntry.Members.Count
Set myAddressEntry = aEntry.Members()
Debug.Print myAddressEntry.Name
Next i
End Sub

  #2  
Old November 10th 06, 06:24 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ActiveInspector Recipient's members (Distribution List) not accessible via Word VBA - Redemption

Looks like you forgot to include the index when looping through the Members
collection:
change
Set myAddressEntry = aEntry.Members()
to
Set myAddressEntry = aEntry.Members(i)

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

wrote in message
oups.com...
Hello all,

I am trying to get the Recipient (Distribution List) from an
ActiveInspector. The code that I am using is below. I am trying to
retrieve the recipient from MS Word VBA. If I put the same code in
Outlook VBA I am able to access the Members of the distribution list.
Now what gets interesting is when I put the code in Word VBA and get a
reference to ActiveInspector.CurrentItem into a SafeMailItem, for some
reason the Recipient's - AddressEntry - Members no longer seem to
be available.

I need to access the distribution list from the recipient of the
ActiveInspector from Word. What am I doing wrong? Is redemption loosing
the recipient properties for some reason?

Even for a normal recipient I am not able to access the PR_DISPLAY_NAME
and PR_SURNAME fields for the address entries when I try to access
these from Word VBA.

I am not able to access the AddressEntry.members.count or any other
properties of AddressEntry.

I would appreciate the help.

Thanks,
neil goundar

************************************************** ************************************************** ****

Public Sub GetRecipientName()
Dim oMail As Outlook.MailItem

Dim sfeMail 'As Redemption.SafeMailItem

Dim intType As Integer

Dim golapp As Outlook.Application
Dim rec

Dim aEntry, myAddressEntry

Set golapp = CreateObject("Outlook.Application", "localhost")

Set oMail = golapp.ActiveInspector.CurrentItem

Set sfeMail = CreateObject("sndRedemption.sndSafeMailItem")

Set sfeMail.Item = oMail

sfeMail.Save

Set rec = sfeMail.Recipients(1)

Debug.Print rec.Name
Debug.Print rec.DisplayType

Set aEntry = rec.AddressEntry

For i = 1 To aEntry.Members.Count
Set myAddressEntry = aEntry.Members()
Debug.Print myAddressEntry.Name
Next i
End Sub



  #3  
Old November 11th 06, 01:57 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 23
Default ActiveInspector Recipient's members (Distribution List) not accessible via Word VBA - Redemption

Dear Dmitry,

I have included the index, in the code already. I pasted some codes
that I was testing and have missed the index in that. Sorry for that,
it was my mistake.

The problem is this:
I cant even access "aEntry.Members.Count" property. I dont even go into
the Loop.

Is there any reason why the value will not be available from Word VBA?

I really appreciate your help.

regards,
neil.

Dmitry Streblechenko wrote:
Looks like you forgot to include the index when looping through the Members
collection:
change
Set myAddressEntry = aEntry.Members()
to
Set myAddressEntry = aEntry.Members(i)

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

wrote in message
oups.com...
Hello all,

I am trying to get the Recipient (Distribution List) from an
ActiveInspector. The code that I am using is below. I am trying to
retrieve the recipient from MS Word VBA. If I put the same code in
Outlook VBA I am able to access the Members of the distribution list.
Now what gets interesting is when I put the code in Word VBA and get a
reference to ActiveInspector.CurrentItem into a SafeMailItem, for some
reason the Recipient's - AddressEntry - Members no longer seem to
be available.

I need to access the distribution list from the recipient of the
ActiveInspector from Word. What am I doing wrong? Is redemption loosing
the recipient properties for some reason?

Even for a normal recipient I am not able to access the PR_DISPLAY_NAME
and PR_SURNAME fields for the address entries when I try to access
these from Word VBA.

I am not able to access the AddressEntry.members.count or any other
properties of AddressEntry.

I would appreciate the help.

Thanks,
neil goundar

************************************************** ************************************************** ****

Public Sub GetRecipientName()
Dim oMail As Outlook.MailItem

Dim sfeMail 'As Redemption.SafeMailItem

Dim intType As Integer

Dim golapp As Outlook.Application
Dim rec

Dim aEntry, myAddressEntry

Set golapp = CreateObject("Outlook.Application", "localhost")

Set oMail = golapp.ActiveInspector.CurrentItem

Set sfeMail = CreateObject("sndRedemption.sndSafeMailItem")

Set sfeMail.Item = oMail

sfeMail.Save

Set rec = sfeMail.Recipients(1)

Debug.Print rec.Name
Debug.Print rec.DisplayType

Set aEntry = rec.AddressEntry

For i = 1 To aEntry.Members.Count
Set myAddressEntry = aEntry.Members()
Debug.Print myAddressEntry.Name
Next i
End Sub


  #4  
Old November 11th 06, 08:21 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ActiveInspector Recipient's members (Distribution List) not accessible via Word VBA - Redemption

That most likely means that Redemption cannot find an existing MAPI session
or log to the default profile
Try to add the following code before you access Members:

set Utils = CreateObject("Redemption.MAPIUtils")
Utils.MAPIOBJECT = golapp.Session.MAPIOBJECT

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

wrote in message
oups.com...
Dear Dmitry,

I have included the index, in the code already. I pasted some codes
that I was testing and have missed the index in that. Sorry for that,
it was my mistake.

The problem is this:
I cant even access "aEntry.Members.Count" property. I dont even go into
the Loop.

Is there any reason why the value will not be available from Word VBA?

I really appreciate your help.

regards,
neil.

Dmitry Streblechenko wrote:
Looks like you forgot to include the index when looping through the
Members
collection:
change
Set myAddressEntry = aEntry.Members()
to
Set myAddressEntry = aEntry.Members(i)

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

wrote in message
oups.com...
Hello all,

I am trying to get the Recipient (Distribution List) from an
ActiveInspector. The code that I am using is below. I am trying to
retrieve the recipient from MS Word VBA. If I put the same code in
Outlook VBA I am able to access the Members of the distribution list.
Now what gets interesting is when I put the code in Word VBA and get a
reference to ActiveInspector.CurrentItem into a SafeMailItem, for some
reason the Recipient's - AddressEntry - Members no longer seem to
be available.

I need to access the distribution list from the recipient of the
ActiveInspector from Word. What am I doing wrong? Is redemption loosing
the recipient properties for some reason?

Even for a normal recipient I am not able to access the PR_DISPLAY_NAME
and PR_SURNAME fields for the address entries when I try to access
these from Word VBA.

I am not able to access the AddressEntry.members.count or any other
properties of AddressEntry.

I would appreciate the help.

Thanks,
neil goundar

************************************************** ************************************************** ****

Public Sub GetRecipientName()
Dim oMail As Outlook.MailItem

Dim sfeMail 'As Redemption.SafeMailItem

Dim intType As Integer

Dim golapp As Outlook.Application
Dim rec

Dim aEntry, myAddressEntry

Set golapp = CreateObject("Outlook.Application", "localhost")

Set oMail = golapp.ActiveInspector.CurrentItem

Set sfeMail = CreateObject("sndRedemption.sndSafeMailItem")

Set sfeMail.Item = oMail

sfeMail.Save

Set rec = sfeMail.Recipients(1)

Debug.Print rec.Name
Debug.Print rec.DisplayType

Set aEntry = rec.AddressEntry

For i = 1 To aEntry.Members.Count
Set myAddressEntry = aEntry.Members()
Debug.Print myAddressEntry.Name
Next i
End Sub




  #5  
Old November 14th 06, 08:28 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 23
Default ActiveInspector Recipient's members (Distribution List) not accessible via Word VBA - Redemption

Hello Dmitry,

That solved my problem. Thank you for your guidance.

neil goundar.

Dmitry Streblechenko wrote:
That most likely means that Redemption cannot find an existing MAPI session
or log to the default profile
Try to add the following code before you access Members:

set Utils = CreateObject("Redemption.MAPIUtils")
Utils.MAPIOBJECT = golapp.Session.MAPIOBJECT

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

wrote in message
oups.com...
Dear Dmitry,

I have included the index, in the code already. I pasted some codes
that I was testing and have missed the index in that. Sorry for that,
it was my mistake.

The problem is this:
I cant even access "aEntry.Members.Count" property. I dont even go into
the Loop.

Is there any reason why the value will not be available from Word VBA?

I really appreciate your help.

regards,
neil.

Dmitry Streblechenko wrote:
Looks like you forgot to include the index when looping through the
Members
collection:
change
Set myAddressEntry = aEntry.Members()
to
Set myAddressEntry = aEntry.Members(i)

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

wrote in message
oups.com...
Hello all,

I am trying to get the Recipient (Distribution List) from an
ActiveInspector. The code that I am using is below. I am trying to
retrieve the recipient from MS Word VBA. If I put the same code in
Outlook VBA I am able to access the Members of the distribution list.
Now what gets interesting is when I put the code in Word VBA and get a
reference to ActiveInspector.CurrentItem into a SafeMailItem, for some
reason the Recipient's - AddressEntry - Members no longer seem to
be available.

I need to access the distribution list from the recipient of the
ActiveInspector from Word. What am I doing wrong? Is redemption loosing
the recipient properties for some reason?

Even for a normal recipient I am not able to access the PR_DISPLAY_NAME
and PR_SURNAME fields for the address entries when I try to access
these from Word VBA.

I am not able to access the AddressEntry.members.count or any other
properties of AddressEntry.

I would appreciate the help.

Thanks,
neil goundar

************************************************** ************************************************** ****

Public Sub GetRecipientName()
Dim oMail As Outlook.MailItem

Dim sfeMail 'As Redemption.SafeMailItem

Dim intType As Integer

Dim golapp As Outlook.Application
Dim rec

Dim aEntry, myAddressEntry

Set golapp = CreateObject("Outlook.Application", "localhost")

Set oMail = golapp.ActiveInspector.CurrentItem

Set sfeMail = CreateObject("sndRedemption.sndSafeMailItem")

Set sfeMail.Item = oMail

sfeMail.Save

Set rec = sfeMail.Recipients(1)

Debug.Print rec.Name
Debug.Print rec.DisplayType

Set aEntry = rec.AddressEntry

For i = 1 To aEntry.Members.Count
Set myAddressEntry = aEntry.Members()
Debug.Print myAddressEntry.Name
Next i
End Sub



 




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
Exporting Members on a distribution list WooYing Outlook - Using Contacts 3 September 29th 06 06:08 AM
members missing from distribution list EZim Outlook - Using Contacts 0 March 20th 06 05:04 PM
Distribution List Members Order Dave Outlook - Using Contacts 4 February 17th 06 04:26 PM
Adding Members to a Distribution List DeeW Outlook - Using Contacts 2 January 24th 06 08:20 PM
Selecting Members for a Distribution List elitomil Outlook - Using Contacts 6 January 21st 06 03:34 PM


All times are GMT +1. The time now is 08:16 PM.


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