hosting Outlook inside a winforms application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to host the outlook calendar control inside a typical winforms
application? I've tried using the outlook view control with somesucces, but
italways locked up VS 2005 any time I tried to use it. And I as never able to
get the one-month view of the calendar. Always only daily view.

thanks
bill
 
What calendar control are you referring to? The only reusable control that Outlook includes for displaying its data is the Outlook View Control.

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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I want to be able show a 1-month view of a calendar inside my application. I
want it to be the same view that you see in outlook, so if that means using
the "Outlook View Control" then thats fine. however I have found the
documentation to be abyssmal and have been unable to use the control
successfully. Placing it on a WinForm in VS 2005 will eventually cause VS to
hang. Also I can't get the view that I want. It seems the only view available
is the Day/Week/Month view which shows just a single day contrary to its
name. I have been unsuccessful in finding any reference to show the specific
string that is required to get a month only view of the outlook view control.
In addition it doesnt support events that I have seen.

I don't really want to make a VSTO add-in either.

If you can provide any pointers or assistance in accomplishing these goals,
I would appreciate it, especially with finding the right string for the
"view" property.

Bill
 
IIRC, you can change the view mode by changing the appropriate element in the OVC's ViewXML property. Compare two View.XML property values, one for a day mode, one for month mode, from a normal Outlook Explorer window to learn what element needs to be changed.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Thanks. After doing a bit of searching, I found a macro to capture and write
out the contents of the ViewXml Property. I had to modify it slightly, but I
wanted to share it here in case someone in the future is asking the same
thing.

Once set the ViewXML property in my own project to the saved XML, I was able
to get a view with the normal month view.

I am still looking for a way to capture and react to events in outlook such
as an appointment changing without writing an Add-in.

Bill


Sub test()
Dim fd As MAPIFolder
Set fd = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile("c:\testfile.txt", True)

f.Write (fd.CurrentView.XML)
f.Close

End Sub


which output this XML

<?xml version="1.0"?>
<view type="calendar">
<viewname>Day/Week/Month</viewname>
<viewstyle>table-layout:fixed;width:100%;font-family:Tahoma;font-style:normal;font-weight:normal;font-size:8pt;color:Black;font-charset:0</viewstyle>
<viewtime>0</viewtime>
<mode>2</mode>
<daymode>5</daymode>
<splitterwidth>-1</splitterwidth>
<splitterheight>-1</splitterheight>
<displaytimeunits>30</displaytimeunits>
<taskfilter>1</taskfilter>
<includenodue>1</includenodue>
<lunarinfotype>0</lunarinfotype>
<rokuyou>0</rokuyou>
<startfield>urn:schemas:calendar:dtstart</startfield>
<endfield>urn:schemas:calendar:dtend</endfield>
<daystyle></daystyle>
<weekstyle></weekstyle>
<monthstyle></monthstyle>
<calendarstyle>font-size:16pt</calendarstyle>
<previewpane>
<markasread>0</markasread>
</previewpane>
<embeddedview type="table">
<viewstyle>table-layout:fixed;width:100%;font-family:Tahoma;font-style:normal;font-weight:normal;font-size:8pt;color:Black;font-charset:0</viewstyle>
<viewtime>0</viewtime>
<linecolor>8421504</linecolor>
<linestyle>3</linestyle>
<gridlines>1</gridlines>
<newitemrow>1</newitemrow>
<incelledit>1</incelledit>
<usequickflags>0</usequickflags>
<collapsestate></collapsestate>
<rowstyle>background-color:#FFFFFF</rowstyle>
<headerstyle>background-color:#D3D3D3</headerstyle>
<previewstyle>color:Blue</previewstyle>
<arrangement>
<autogroup>0</autogroup>
<collapseclient></collapseclient>
</arrangement>
<column>
<name>HREF</name>
<prop>DAV:href</prop>
<checkbox>1</checkbox>
</column>
<column>
<heading>Icon</heading>
<prop>http://schemas.microsoft.com/mapi/proptag/0x0fff0102</prop>
<bitmap>1</bitmap>
<width>18</width>
<style>padding-left:3px;;text-align:center</style>
</column>
<column>
<format>boolicon</format>
<heading>Complete</heading>
<prop>http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/811c000b</prop>
<type>boolean</type>
<bitmap>1</bitmap>
<maxrows>28770304</maxrows>
<width>35</width>
<style>padding-left:3px;;text-align:center</style>
<displayformat>3</displayformat>
</column>
<column>
<heading>TaskPad</heading>
<prop>urn:schemas:httpmail:subject</prop>
<type>string</type>
<width>15</width>
<style>padding-left:3px;;text-align:left</style>
<userheading>TaskPad</userheading>
</column>
<groupbydefault>0</groupbydefault>
<previewpane>
<markasread>0</markasread>
</previewpane>
</embeddedview>
</view>
 
Back
Top