O2003 - Open Group Calendar connected to public folder

F

Frank Bouillon

Hi,

I made a macro (O 2003), wich changes to a public calendar folder and opens
a group calendar connected to this calendar via SendKeys.

On my machine that's working fine even if I am in an email or contacts
folder.

On my clients machines the macro overhauls itself and the menubar for the
calendar is not yet available when I trigger SendKeys.

************** CODE ****************
Function OpenGroupCalendar(strGTP As String)
Dim ALL_VAR As OBJECT_XY

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")

Set myFolder = myNameSpace.Folders("Public Folder").Folders("All Public
Folders").Folders("CompanyXY").Folders("CalendarAccounting")


Set myExplorer = myOlApp.ActiveExplorer
Set myExplorer.CurrentFolder = myFolder

Set cbb = ActiveExplorer.CommandBars.FindControl(, 7002)
SendKeys "%ö"
If Not cbb Is Nothing Then cbb.Execute

Set ALL_VAR = Nothing
End Function
************ END OF CODE **************

Thank you
Frank
 
M

Michael Bauer [MVP - Outlook]

Am Fri, 18 Aug 2006 10:57:31 +0200 schrieb Frank Bouillon:

Frank, SendKeys is never a stable solution. In your case, what should that
be good for?

If you want to make that group calendar the current one then you could do
that directly:

Dim Folder as Outlook.MapiFolder
Set Folder = ....
Set Application.ActiveExplorer.CurrentFolder = Folder
 
S

Sue Mosher [MVP-Outlook]

Michael, I think Frank is talking not about a calendar folder but about a group calendar item. Those aren't accessible programmatically, except to set properties with CDO or Redemption.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Michael Bauer [MVP - Outlook]

Am Sat, 19 Aug 2006 08:08:33 -0400 schrieb Sue Mosher [MVP-Outlook]:

Oh, you´re right.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Michael, I think Frank is talking not about a calendar folder but about a
group calendar item. Those aren't accessible programmatically, except to set
properties with CDO or Redemption.
 
F

Frank Bouillon

Hi Sue,
you're right.

.... but unfortunately that doesn't help me any further.

It works with SendKeys but if the menubar is not yet available its useless.

I thought doing a little Loop until the menubar is available but I don't
know how to check this.

Something like:
Do until Application.MenuBars("CalendarMenuBar") = True
x = x + 1
Loop

Thanks for any futher help.
Frank


"Sue Mosher [MVP-Outlook]
" Michael, I think Frank is talking not about a calendar folder but about a
group calendar item. Those aren't accessible programmatically, except to set
properties with CDO or Redemption.

"Michael Bauer [MVP - Outlook]">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top