Link to home
Start Free TrialLog in
Avatar of jjnet123
jjnet123

asked on

Initialise (initialize) public folders for access with VBA

Thanks for reading.

Ok, so I have a well established bit of code which sits happily on a machine reading the contents of a public mail folder through Outlook, stripping off attachments and recording the path to which they were saved, taking the HTML from the e-mail and putting it in a rich text field, and identifying key words in the subject line which prompts users to do various things with the content.

My problem is that every so often Exchange needs to restart, and this machine loses contact with the public folders. Apparently when Outlook first opens, public folders are not populated to save on overheads. It takes a user to manually browse them from Outlook to initialise them. Only then can they be accessed through VBA.

This means that someone has to manually log on and poke the public folder, which I'd rather didn't need to happen.

I've tried all I can think of, including using the popular "GetFolder" function, then telling Access to .Display the folder. This simply fails (no error, the window just closes as soon as it opens). GetFolder does seem to be able to retrieve the folder successfully though.

Does anyone know a way to initialise Outlook public folders from VBA in Access?
Avatar of ste5an
ste5an
Flag of Germany image

As far as I understand you:
You're automating Outlook to do some mail fiddling.
This is a long running process.
Exchange restarts.
You want to reconnect your automation instance?

Imho you should reduce the amount of time needed for your process,
Avatar of jjnet123
jjnet123

ASKER

Thanks for the comment, however the process is a short one. It's called every few minutes to look at the mailbox and process anything new in there.

It sits there and runs, 24/7. It works well, apart from this one issue.

An alternative would be to tell Outlook to initialise the folder when it starts I suppose, but I'm not sure where to start with that.
ASKER CERTIFIED SOLUTION
Avatar of jjnet123
jjnet123

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
Nobody else was able to advise.