I'd separate that line into two, the first one getting the EntryID from your
list object as a string. Then you can see if you are getting an actual
value. The line you indicate should cause no errors unless indx or your list
object aren't set correctly before you call GetItemFromID. You also might
not have set "nms" as the NameSpace object. It's hard to tell from
abbreviated code. Are you setting "nms", I don't see that.
Don't rely on an EntryID having any specific number of characters, it can
vary widely.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"Edward" wrote in message
...
Hi,
I have a userform with a list that keeps email EntryId, Sendername,
Subject
, Recieved date.
EntryID which is a 140 long string is in the first column (0) and is
hidden.
A simplified version of my code is :
sub done()
Dim msg As Outlook.MailItem
Dim nms As Outlook.NameSpace
Dim fld As Outlook.MAPIFolder
Set msg = nms.GetItemFromID(lstQueue.List(indx, 0)) - generates error
With msg
.Subject = "DONE - "
.Display
End With
End sub
lstQueue.List(indx, 0)) correctly keeps the EntryID , but the line I
showed
with an arrow generates an error "Object variable or with block not set" .
I can't figure out what's wrong , Any help will be greatly appriciated.
I don't know if the reason for this error is not useing the storeID ?
--
Best regards,
Edward