Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Method failed (Outlook 2003 VBA)

    I've had trouble retrieving Contacts fields. The simplieid code, for testing purposes is as follows:

    MsgBox ActiveExplorer.CurrentFolder.Items.Item(1).FullNam e

    When this code runs, a message displays: Method "FullName" of object "ContactItem" failed.

    This never occurs with a locally cached Outlook folder. But when they folder is a delegated folder, the error factor occurs. The determining factor (when it fails or not for a non-local Contacts folder) seems to be whether the Contacts folder is delegated as another user's mailbox, or simply opened as a shared folder.

    Is there a reason why this code fails? Is there a way to avoid this problem?

    Many thanks,
    Richard

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Method failed (Outlook 2003 VBA)

    I'm at home without access to any remote Contacts to test against at present, but one thought is that

    ActiveExplorer.Selection(1).FullName

    will error if the item is a Distribution List. Is it possible that

    ActiveExplorer.CurrentFolder.Items.Item(1)

    is a DistList? (.Item(1) is not necessarily the first item displayed - it's either the oldest item in the collection or the one with the lowest .EntryID - not sure which. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>) Sooooooo ... can you at least return the .Class?

    ActiveExplorer.CurrentFolder.Items.Item(1).Class

    A ContactItem will return 40, a DistList will return 69.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Method failed (Outlook 2003 VBA)

    No, this is not a DistList. I specified that particular lin of code in my post because it was the simplest representation of my problem. The same problem occurs with Selection (what I usually work with) or with ANY index number of the Items in the Contact folder in question.

    In the real world situation of this, we use an EXE with Outlook Redemption. No error or message occurs with that, so I reduced my testing to a single line of code.

    Richard

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Method failed (Outlook 2003 VBA)

    On a little further research (Sue Mosher's book <img src=/S/grin.gif border=0 alt=grin width=15 height=15>), I think you have to use the

    <object>.GetSharedDefaultFolder(recipient, defaultfoldertype)

    Method to get a shared folder. The 'recipient' argument has to be a valid server mailbox. See this Outlookcode.com discussion for an example.

    You could also see if CDO or Redemption makes this easier; I'm not experienced with those libraries.
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Method failed (Outlook 2003 VBA)

    Thanks. We are using Redemtpion for this, which is where the problem arose. I switched to the more simple native VBA code to troubleshoot. I'll explore further and refer to Sue's book.
    Richard

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Method failed (Outlook 2003 VBA)

    I'm now out of my depth, but in scanning the Redemption Objects reference,

    http://www.dimastr.com/redemption/objects.htm#reference

    I don't see a GetSharedDefaultFolder equivalent Method, though perhaps it's buried in the E-MAPI stuff:

    http://www.dimastr.com/redemption/utils.htm#xmapi

    There are a couple of Loungers with more expertize in CDO and Redemption than I have, I'll point them to this thread.
    -John ... I float in liquid gardens
    UTC -7ąDS

  7. #7
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Method failed (Outlook 2003 VBA)

    It doesn't seem that I would need to "Get" the folder. It's already the current folder. I think I mentioned that I'm able to retrive the Contact properties that I want much of the time. On occasion, especially if the entire mailbox is delegated, the command (which functions as expected in other situations), fails. It's certainly possible that this is occurring because of the way we have delegated; yet things occasionally function as expected.

    I would appreciate any intput.

    Thanks,
    Richard

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Method failed (Outlook 2003 VBA)

    Can you post a .bas file (change extension to .txt) that someone without Redemption could import for easy testing? I don't have any delegated folders myself, but I have given access to some other folks and maybe I will be able to try it on one of their computers. However, I'll need to be "in and out" very quickly, hence my request for a demo module.

  9. #9
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Method failed (Outlook 2003 VBA)

    The code I'm testing with is just one line...

    MsgBox ActiveExplorer.Current.Folder.Items.Item(1).FullNa me

    Item(1) could be any index within the .Count of the Items.

    This code raises the following: Method 'FullName' of object "ContactItem' failed.

    This occurs only with shared Contact folder when the entire mailbox is delegated. On local Contact folders (the user's own), there is no problem. There is also no problem if the Exchange Outlook folder is opened as a shared folder.

    Thanks,
    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •