getfolder

  • Thread starter Thread starter mxayahoo
  • Start date Start date
M

mxayahoo

hi,

I am writing a simple macro to look up some items in a folder :

Sub check_items()
Dim nSpace As NameSpace
Dim objFolder As MAPIFolder
Dim objMail As MailItem
Set nSpace = Application.GetNamespace("MAPI")
Set objFolder = nSpace.Folders("myemails")
'..... more code here

End Sub

nSpace.Folders fails with : an object can not be found
any help is appreciated

thanks
Michael
 
hi,

I found the answer

Set objFolder = nSpace.Folders(1).Folders("myemails")

thanks
Michael
 
Back
Top