Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

Help VBA that opens a folder but and sometimes wont take me to said folder

I been working with a VBA the experts had helped me with where it would open the folder of a PST.  The line is
Set oOutlook.ActiveExplorer.currentfolder = oSearchFolder

Open in new window


However, the control doesn't take me there all the time to the folder rather opens up the folder - I still have to scroll down to that folder (sometimes it works and takes me there other no-go).

How can modify the above line or what command or function can take me to that folder?
ASKER CERTIFIED SOLUTION
Avatar of Daniel Pineault
Daniel Pineault

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 jana

ASKER

Strange...
Avatar of Bill Prew
Bill Prew

That's about what I had discovered during the prior related question, but was hoping someone might know a way around it...


»bp
Avatar of jana

ASKER

So strange... now I log off Outlook and log on, and running the macro, it doesn't go to the folder; like Daniel says "center itself" on the folder name requested.  I have tried to recreate when it did run ok, but no way.
Yes, it was somewhat hot or miss when I was testing here too...


»bp
Avatar of jana

ASKER

:(
SOLUTION
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 jana

ASKER

Hi!,

Incorprate the script?
Sub Folder_Inbox()
    ActiveExplorer.ShowPane olFolderList, True
    Set ActiveExplorer.CurrentFolder = Session.GetDefaultFolder(olFolderInbox)
End Sub

Open in new window


That is, replacing the prior in the same line?
Avatar of jana

ASKER

In my case  change olFolderList with  FolderName?
Avatar of jana

ASKER

Nop, didn't work...
SOLUTION
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
SOLUTION
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
SOLUTION
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
SOLUTION
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
SOLUTION
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 jana

ASKER

will try
Avatar of jana

ASKER

Ok, thanx guys! (CTRL-Y  does not help; same as going thru the folders as in the left pane- but thank u! The reason is that have a userform that displays the PSTs/folders that when run, opens up the said folder but doesn't take me to the folder - control stays in inbox)
Avatar of jana

ASKER

Thank u!
Welcome!


»bp