Results 1 to 5 of 5
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Lost object (2002 SP-3)

    I have a module that retrieves e-mailed confirmation of orders through Outlook. This has functioned well over the last several months. Over the past few days I've had some real issues with OL and wonder if something got moved or corrupted; running the code (attached) now results in the following msg: "The operation failed. An object could not be found." Because this code was graciously supplied by HansV, I have no clue how it works or what has happened. I only suspect that a folder (in OL) got moved or something. There is a line of code highlighted in the attachment that I suspect may be the place to look but, as I've said, I don't really have a clue. Perhaps this is something only HansV can help me with?

    The "path" of the folder in OL containing the "Load Confirmations" is: Outlook Today > Personal Folders > Inbox > Load Confirmations. The code mentions ".GetDefaultFolder" but I don't see where a "default" folder is defined in the code or OL. Hans! Where for art thou?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Lost object (2002 SP-3)

    The highlighted line is

    Set objOLFolder = objOLNameSpace.GetDefaultFolder(olFolderInbox).Par ent.Folders("Load Confirmations")

    In this line, objOLNameSpace.GetDefaultFolder(olFolderInbox) returns a reference to the Inbox. GetDefaultFolder returns one of the "standard" Outlook folders; which one is specified by the argument between parentheses, in this example olFolderInbox.

    Try the following: temporarily make the line

    On Error GoTo ErrHandler

    into a comment by inserting an apostrophe ' in front of it. If you try to run the code now, you should be offered the option to debug. If you do so, the code will pause on a specific line. Which line is that?

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Lost object (2002 SP-3)

    I'll be darned, it's actually the line I have highlighted in the attachment.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Lost object (2002 SP-3)

    Apparently, the Load Confirmations folder has been moved to inside the Inbox. Change the line to

    Set objOLFolder = objOLNameSpace.GetDefaultFolder(olFolderInbox).Fol ders("Load Confirmations")

    If it works, don't forget to uncomment the On Error line.

  5. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Lost object (2002 SP-3)

    <img src=/S/bullseye.gif border=0 alt=bullseye width=45 height=15>
    Another module of the same type looks for "Weight Requests" and it too was a folder that was moved "inside" the Inbox. All better now!
    It must be exhausting for you my friend (write code, drag Bryan. . .write code, drag Bryan. . .write code,. . .) Thanks again!!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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