Link to home
Start Free TrialLog in
Avatar of vbWayne
vbWayne

asked on

Outlook Folder

Increaded to 25 for working answer

I use this function I found on the net to open my mail (Outlook98) in the InBox.
However, it opens half screen..anyone know how to adjust it to have it open the folder maximized?'open folder in outlook

Public Function OpenFolder(FldrName As String)
    Dim olApp As New Outlook.Application
    Dim nsMAPI As Outlook.NameSpace
    Set nsMAPI = olApp.GetNamespace("MAPI")
    Dim d As Long
    For d = 1 To nsMAPI.Folders.Count
        Dim p
        For p = 1 To nsMAPI.Folders.Item(d).Folders.Count
            If nsMAPI.Folders.Item(d).Folders.Item(p).Name = FldrName Then
 nsMAPI.Folders.Item(d).Folders.Item(p).Display
                Exit Function
                End If
            Next p
        Next d
End Function

'thanks,
'Wayne


ASKER CERTIFIED SOLUTION
Avatar of MTroutwine
MTroutwine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vbWayne
vbWayne

ASKER

Adjusted points to 25
Avatar of vbWayne

ASKER

My inexperience is showing up big time.

Thanks,
Wayne
Avatar of vbWayne

ASKER

My inexperience is showing up big time.

Thanks,
Wayne
Avatar of vbWayne

ASKER

My inexperience is showing up big time.

Thanks,
Wayne
Avatar of vbWayne

ASKER

Even more...
Your code doesn't work..olApp.ActiveWindow.WindowState = olMaximized

it says olMaximized variable not declared
If i try vbMaximized or 3 it says it doesn't support this property..

Help
               

vbWayne,

Sorry for the delay in responding, doing the weekend thing.  The code works fine for me, I will try it on my test machine and see what it does!  Be back shortly...




Avatar of vbWayne

ASKER

No problem...thanks for staying connected..
Actually when I do the ActiveWindow.
and the box opens with all the possibilities...there is no window state.

Later

Not urgent...it's the weekend...enjoy
I apoligize, I tested this without thinking my workstation is running Outlook 2000.  As soon as I tried this on my test machine, running Outlook 98 it bombed out.  Shouldn't be a problem to fix though.  Actually WindowState doesn't appear in Outlook 2000 either, kind of funny actually.

Thanks!
Avatar of vbWayne

ASKER

OK.
out of curiosity, where are you located...it's 6:08pm here and your posting says 2:02pm. Ontario, Canada here or is it just the clocks on this site out of whack.

The locks are kind of whack 'o on the site.  I am located on the Iowa/Illnois border in the US.  I am on the Iowa side, but Illinois is 10 minutes away!
Well not so good news here.  After not being able to get this to work, I called a friend who's sole  purpose in lief is Office development.  He informed me that until Outlook 2000, WindowState and the ability to control Minimize, Maximize and Restore of an Outlook window programatically was not supported.  He pointed me to this article which covers the new properties, methods, etc. covered in Outlook 2000.  

http://msdn.microsoft.com/library/techart/o2kwhatsnew.htm

If you look under properties you will find WindowState as a new property.  

I would be more than glad to contact the folks at EE to get your points back to you.

:>)
Avatar of vbWayne

ASKER

Don't worry about the points, you earned them...my question has been answered (just can't be done)...
......thanks for the above and beyond the call of duty reply.

Wayne