how do i use vb.net to choose the mailbox folder instead of using pickfolder

Using the code below, I would like oMailbox to choose the Mailbox folder by default instead of using .pickfolder to bring up the popup box and having to select it from the list. Any ideas?
Dim oPst As String = "\\" & System.Environment.MachineName & "\C$\Users\" & System.Environment.UserName & "\Documents\Outlook\EE Migration Temp Mailbox.pst"
        Dim AppDataPst As String = "\\" & System.Environment.MachineName & "\C$\Users\" & System.Environment.UserName & "AppData\Local\Microsoft\Outlook\EE Migration Temp Mailbox.pst"
        Dim oFolder As Outlook.MAPIFolder = Nothing
        Dim oMailbox As Outlook.MAPIFolder = Nothing
        Dim app As New Outlook.Application()
        Dim ns As Outlook.NameSpace = app.GetNamespace("MAPI")

oFolder = ns.Session.Folders.GetLast
oMailbox = ns.Session.PickFolder

Open in new window

nebiaat5Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
Do you mean this?

oMailbox = app..GetNamespace("Mapi").GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)


http://www.vbdotnetheaven.com/UploadFile/hirendra_singh/Outlook1109172009030335AM/Outlook11.aspx
0
nebiaat5Author Commented:
That is sort of what i want. That only chooses the inbox, I want it to choose the actual Mailbox with all the folders underneath, such as inbox, contact, calendars, etc...

Not sure if it is possible, but if it is not, using the code you provided, is there a way to make it copy the items inside the inbox to a pst file programatically as well?

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.