Dear All,
I am using following code to get e mail from a folder..say from an INBOX .
Problems:Sub GetFromInbox() Dim olApp As Outlook.Application Dim olNs As NameSpace Dim Fldr As MAPIFolder Dim olMail As Variant Dim i As Integer Set olApp = New Outlook.Application Set olNs = olApp.GetNamespace("MAPI") Set Fldr = olNs.GetDefaultFolder(olFolderInbox) i = 1 For Each olMail In Fldr.Items If InStr(olMail.Subject, "Credit_Watch") > 0 Or _ InStr(olMail.Subject, "Prepaid") > 0 Then ActiveSheet.Cells(i, 1).Value = olMail.ReceivedTime i = i + 1 End If Next olMail Set Fldr = Nothing Set olNs = Nothing Set olApp = Nothing
1/ I am getting Error object variable or with block variable not set .This code was never written for outlook 2007 which I am using right now ..
Possible Clue:
I tried to tweak Alt11~tools~References ,but with no sucess
here is the path for the code : http://www.*****-clicks.com/excel/olRetrieving.htm
..Very intresting reading
Regards
N![]()
do you know how to break your code and then step through it?
On which line do you get your error?
not exactly i am stuck all the way from the beginning ..
N
Ok so go do some googling on how to step through code. Then put a break point on the first line and step through it. Hover you mouse over objects and variables after the code has passed that line to see what values pop up. And the most important note down on which line the error happens.
Thanks, E-mail is universal, you can retrieve it from anywhere and from any computer, if you can access the server on which the e-mail is stored.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks