Group:  Microsoft Outlook ยป microsoft.public.outlook.program_vba
Thread: Error accessing Outlook folder

Geek News

Error accessing Outlook folder
"John" <info[ at ]nospam.infovis.co.uk> 12/26/2008 5:37:57 AM
Hi

I am trying to access the Draft folder using the following vb.net code;

Dim objOutlook As Object = CreateObject("Outlook.Application")
Dim oNS As Object = objOutlook.GetNamespace("MAPI")
Dim oFld As Object = objOutlook.Folder

oFld = oNS.GetDefaultFolder(olfolderDrafts)

Problem is I am getting a "Public member 'Folder' on type 'ApplicationClass'
not found." error on the line Dim oFld As Object = objOutlook.Folder. What
is the issue and how can I fix it?

Thanks

Regards


Re: Error accessing Outlook folder
"Michael Bauer [MVP - Outlook]" <mb[ at ]mvps.org> 12/27/2008 2:25:52 PM


I assume this should work:
Dim oFld As Object = oNS.GetDefaultFolder(olfolderDrafts)

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Fri, 26 Dec 2008 05:37:57 -0000 schrieb John:

[Quoted Text]
> Hi
>
> I am trying to access the Draft folder using the following vb.net code;
>
> Dim objOutlook As Object = CreateObject("Outlook.Application")
> Dim oNS As Object = objOutlook.GetNamespace("MAPI")
> Dim oFld As Object = objOutlook.Folder
>
> oFld = oNS.GetDefaultFolder(olfolderDrafts)
>
> Problem is I am getting a "Public member 'Folder' on type
'ApplicationClass'
> not found." error on the line Dim oFld As Object = objOutlook.Folder. What
> is the issue and how can I fix it?
>
> Thanks
>
> Regards

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net