getfolder

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
 
M

mxayahoo

hi,

I found the answer

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

thanks
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top