Sign in to follow this  
Followers 0
Guest manboak

Exporting Outlook Calendar as Webpage

10 posts in this topic

Hi - Under the File Menu in Outlook 2003 you can 'Save as Web Page' - I would like to automate this so that others can look at my calendar on a network drive or (ideally) get it ftp'd to a website for people outside my network.

I've spent about 3 hours trying a variety of approaches. My VBA is pretty weak so I thought Autoit would fill the gap but nothing seems to work. I can get autoit to open outlook in the Calendar view (using a command line switch) but I can access the appropriate menu control.

Below is the syntax I've tried - much of it was commented out after it did not work. Any help would be appreciated. This is my last try for a few months on this as I can't justify spending more hours on this right now.

Thanks, Seth

Run ("C:\Program Files\Microsoft Office\OFFICE11\Outlook.exe /select outlook:calendar")

WinWaitActive ("Calendar - ", "")

;none of the functions below seem to work

;Send ("!f")

;ControlFocus ("Calendar - ", "Microsoft Outlook", "NetUIHWND1" )

;ControlClick ("Calendar - ", "Microsoft Outlook", "MsoCommandBar1" )

;WinMenuSelectItem ("Calendar -","","&f","Save as Web Page...")

Share this post


Link to post
Share on other sites



Hi - Under the File Menu in Outlook 2003 you can 'Save as Web Page' - I would like to automate this so that others can look at my calendar on a network drive or (ideally) get it ftp'd to a website for people outside my network.

I've spent about 3 hours trying a variety of approaches. My VBA is pretty weak so I thought Autoit would fill the gap but nothing seems to work. I can get autoit to open outlook in the Calendar view (using a command line switch) but I can access the appropriate menu control.

Below is the syntax I've tried - much of it was commented out after it did not work. Any help would be appreciated. This is my last try for a few months on this as I can't justify spending more hours on this right now.

Thanks, Seth

Run ("C:\Program Files\Microsoft Office\OFFICE11\Outlook.exe /select outlook:calendar")

WinWaitActive ("Calendar - ", "")

;none of the functions below seem to work

;Send ("!f")

;ControlFocus ("Calendar - ", "Microsoft Outlook", "NetUIHWND1" )

;ControlClick ("Calendar - ", "Microsoft Outlook", "MsoCommandBar1" )

;WinMenuSelectItem ("Calendar -","","&f","Save as Web Page...")

Old fashion but can you tab to the controls you need?

Rick


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

Thanks Rick - no I can't tab because the default focus is on the first calender entry, not on the menu controls. Repeated tabbing just takes me through all my appointments. Hope that makes sense. -Seth

Share this post


Link to post
Share on other sites

Hi.

I think you should go with the WinMenuSelectItem approach.

But due to the hide underlined letters feature in recent windows versions it can sometimes be tricky to see how menuitems should be called.

The WinMenuSelectItem also seem to be case-sensitive, plus you have to type &File instead of just &f, it does NOT work as SEND.

Let's test...

First a working example.

Run ("notepad")
WinWaitActive ("Untitled -", "")
WinMenuSelectItem ("Untitled -","","&File","Save &As...")

Next a non working...

Run ("notepad")
WinWaitActive ("Untitled -", "")
WinMenuSelectItem ("Untitled -","","&file","Save &As...")

The only difference is the &file

I say good luck with it.

Sorry I couldn't provide a complete example, but I do not use Outlook myself.

Share this post


Link to post
Share on other sites

WinMenuSelectItem() won't work with virtually any Microsoft product in general, and especially not any Office product; they use non-standard menu's.

Share this post


Link to post
Share on other sites

Have you tried:

Send ("{ALTDOWN}")

Send ("F")

Send ("{ALTUP}")

Send ("A")

Don´t know if the command is correct, but you got the idea

Then its enough if the window is focused.


Were ever i lay my script is my home...

Share this post


Link to post
Share on other sites

Thanks Doxie - worked great. I ended up using the script below to export my calendar, still need to automate the ftp...but that isn't a ms product :-)

Cheers, Seth

Run ("C:\Program Files\Microsoft Office\Office11\Outlook.exe /select outlook:calendar")

WinWaitActive ("Calendar -","")

Send("{ALTDOWN}")

Send("F")

Send("{ALTUP}")

Send("{Tab}")

Send("{Tab}")

Send("{Tab}")

Send("{Tab}")

Send("{enter}")

Send("{enter}")

Share this post


Link to post
Share on other sites

Thanks Doxie - worked great. I ended up using the script below to export my calendar, still need to automate the ftp...but that isn't a ms product :-)

Cheers, Seth

Run ("C:\Program Files\Microsoft Office\Office11\Outlook.exe /select outlook:calendar")

WinWaitActive ("Calendar -","")

Send("{ALTDOWN}")

Send("F")

Send("{ALTUP}")

Send("{Tab}")

Send("{Tab}")

Send("{Tab}")

Send("{Tab}")

Send("{enter}")

Send("{enter}")

Hmmmmm

I seem to recall someone asking you if you could tab?

lol

Rick


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

Thanks Doxie - worked great. I ended up using the script below to export my calendar, still need to automate the ftp...but that isn't a ms product :-)

Cheers, Seth

Run ("C:\Program Files\Microsoft Office\Office11\Outlook.exe /select outlook:calendar")

WinWaitActive ("Calendar -","")

Send("{ALTDOWN}")

Send("F")

Send("{ALTUP}")

Send("{Tab}")

Send("{Tab}")

Send("{Tab}")

Send("{Tab}")

Send("{enter}")

Send("{enter}")

You can save a few lines.

Run ("C:\Program Files\Microsoft Office\Office11\Outlook.exe /select outlook:calendar")
WinWaitActive ("Calendar -","")

Send("!f")
Send("{Tab 4}")
Send("{enter 2}")

Single keys can also be repeated, e.g.

    Send("{DEL 4}") ;Presses the DEL key 4 times

    Send("{S 30}") ;Sends 30 'S' characters

    Send("+{TAB 4}) ;Presses SHIFT+TAB 4 times

also sending "F" is sending shift+f, sending "f" sends only "f", so "!f" will probably work where "!F" wasn't.

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

Thanks for the tips - works great!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0