|
-
May 29th, 2008, 03:07 AM
#1
Thread Starter
Lively Member
[2005] - Display Shared Outlook Calendar in Application
Hi All,
I've tried finding articles relating to this question without success. I would like to display a shared outlook calendar within my application which allows the normal functions of an outlook calendar. Any suggestions / links would be much appreciated.
-
May 29th, 2008, 03:32 AM
#2
Re: [2005] - Display Shared Outlook Calendar in Application
AFAIK there is no Outlook control like that for use in VB. You will have to recreate it probably using the Outlook Object Model.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 29th, 2008, 10:53 PM
#3
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
Thanks for the reply. I found a team calendar form that mimics an outlook calendar but it was written in C# and converting it to VB would take forever. Does anyone know of anything similar which has been written in VB?
-
May 29th, 2008, 10:55 PM
#4
Re: [2005] - Display Shared Outlook Calendar in Application
There are free utilities and sites that have code converters.
http://tangiblesoftwaresolutions.com is one that offers a free unlimited time trial version.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 30th, 2008, 02:31 AM
#5
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
Cheers for the link. The project has been converted but when I make changes, the following error message is displayed.
Code generation for property 'CalendarItems' failed. Error was: 'Type 'CalendarLibrary.CalendarItem' In Assembly 'CalendarLibrary, Version = 1.0.3071.26008, Culture = neutral, PublicTokenKey = null' is not marked as serializable.
I looked around google and found an article on 'codeproject' which I downloaded and built but I have no idea how to use it.
-
May 30th, 2008, 02:37 AM
#6
Re: [2005] - Display Shared Outlook Calendar in Application
Sounds like the serializable attribute is missing from for the class that contains the CalendarItems property.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 30th, 2008, 02:56 AM
#7
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
Any suggestions on how to fix it? Would I have have to go back to the source code, add the attribute and re-compile?
-
May 30th, 2008, 03:09 AM
#8
Re: [2005] - Display Shared Outlook Calendar in Application
Lets start at the beginning.
Before you converted the C# code you tested it and it compiled and ran? what version is the C# code for and what version of VS are you using?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 30th, 2008, 03:31 AM
#9
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
The project compiled and ran under C# but I get the same error message in the C# Project (e.g When I change the name of the Form). Not sure what you mean by C# Version but I found v2.0.50727. Visual Studio 2008 is being used for this project.
-
May 30th, 2008, 03:45 AM
#10
Re: [2005] - Display Shared Outlook Calendar in Application
Can you post the link to the project? If it gave an error before you converted it then there is a problem with the original code, not the conversion.
Ps, if you dont change the name of the form does it work?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 30th, 2008, 06:57 AM
#11
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
Link to the file is Here
The form works as expected after it has been compiled. Changing a control name etc then compiling / saving will display that serialization error.
-
May 30th, 2008, 09:59 AM
#12
Re: [2005] - Display Shared Outlook Calendar in Application
I'm sure there will be a better way (so ive probably wasted the last 25 mins of my life) but here is one way you could extract the existing appointments from the calendar:
vb.net Code:
'make sure you include this if you are going to try and use this example Imports Microsoft.Office.Interop 'I just copied and pasted my entire form so this is just the standard windows form class declaration Public Class Form1 'Declare the outlook objects we are going to use Dim app As Outlook.Application Dim calendarcontents As Outlook.MAPIFolder 'Im just using the Form Load event to fill the datagridview Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load app = New Outlook.Application 'Log in to Outlook profile, this must already exist on the PC app.Session.Logon("Outlook_Profile_Name_Here", "Password_Here", False, True) 'Get the default calendar for this outlook profile calendarcontents = app.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar) 'Loop through all items in the calendar and add them to my datagridview control For i As Integer = 1 To calendarcontents.Items.Count appointmentgrid.Rows.Add() appointmentgrid.Rows(i - 1).Cells("starttime").Value = calendarcontents.Items(i).Start appointmentgrid.Rows(i - 1).Cells("endtime").Value = calendarcontents.Items(i).End appointmentgrid.Rows(i - 1).Cells("title").Value = calendarcontents.Items(i).subject Next End Sub End Class
In that example I am just adding the start time, end time and subject/title to a DataGrideView control. I'm sure if you really ran out of options you could just create your own calendar and then possibly use the methods I have used above to add existing appointmets to it. Also, in my example I am just getting the default mailbox's calender folder, you could specify a specific mailbox's calendar using the \\mailboxname\calendar format.
If you search google you will find a way to add appointments as well so you could just use your DIY calendar control to add appointments as well.
Note - I added a reference to the Outlook 11.0 Object Library and obviously Outlook needs to be installed on the machine that this would run from or the code will not work. At the end of the day, if you have to resort to this method you might decide its easier to just let the users use Outlook to add appointments instead of doing it through your app as I can see it being quite a bit of work.
Like I said though, someone else will probably have a better solution
Last edited by chris128; May 30th, 2008 at 10:13 AM.
-
May 30th, 2008, 08:42 PM
#13
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
Hi chris128,
That would work perfectly but is it possible to update the datagrid based on a certain date. Also, the calendar in question is actually located in a public folder and relies on NT security permissions for access.
-
May 31st, 2008, 05:37 AM
#14
Re: [2005] - Display Shared Outlook Calendar in Application
erm yeah you could use the method I described above to loop through all of the calendar appointment items but add an IF statement in that basicaly says if the start date is equal to the date that the user has selected then show the details of the appointment in the datagrid and if not, then hide the details. Hope that makes sense.
To access the shared calendar in a public folder I believe you would just use the FolderPath property and point it to "\\Public Folders\foldername\calendarname"
-
May 31st, 2008, 01:38 PM
#15
Re: [2005] - Display Shared Outlook Calendar in Application
You have to transverse the Public folders one level at a time and not use the full path all at once. Also, that is the default public folder name which of course could be named differently.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 31st, 2008, 04:57 PM
#16
Re: [2005] - Display Shared Outlook Calendar in Application
 Originally Posted by RobDog888
You have to transverse the Public folders one level at a time and not use the full path all at once. Also, that is the default public folder name which of course could be named differently.
oh right, I didnt know you could only traverse one folder at a time... how odd.
-
May 31st, 2008, 05:12 PM
#17
Re: [2005] - Display Shared Outlook Calendar in Application
Yea, it makes for a pain in coding but you'd figure they would have given some kind of functionality like Explorer can go directly to a complete path. In Outlook you have the GetFolderFromID but you'd have to know/store the .EntryID first of that public folder.
Although you can go like so...
oApp.Session.Folders.Item(0).Folders.Item(0).Folders.Item(0).Name
etc. to drill down the folder path if you know where you need to go.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 1st, 2008, 01:43 AM
#18
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
Using "oApp.Session.Folders.Item" could cause some grief because the directory structure could be changed at any given time. Is it possible to scan exchange / outlook for what calendars a user has permission to access and then place them in a drop down list?
After selecting one of the calendars, the contents will be displayed.
P.S - How did you go with the link that I posted RobDog888?
-
Jun 1st, 2008, 03:24 AM
#19
Re: [2005] - Display Shared Outlook Calendar in Application
It runs for me but my conversion utility is on my other system so I'll try converting it tomorrow (just stopped by for a quick visit).
If you only changed the control name in the Calendar.cs class then it wil break as the control name is referenced throughout the entire project. You need to change it everywhere to keep it working.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 1st, 2008, 03:25 AM
#20
Re: [2005] - Display Shared Outlook Calendar in Application
 Originally Posted by nolim8ts
Using "oApp.Session.Folders.Item" could cause some grief because the directory structure could be changed at any given time. Is it possible to scan exchange / outlook for what calendars a user has permission to access and then place them in a drop down list?
After selecting one of the calendars, the contents will be displayed.
P.S - How did you go with the link that I posted RobDog888?
This was only in reference to drilling down the public folders as th first three folders do not get renamed once they are set.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 3rd, 2008, 08:24 PM
#21
Thread Starter
Lively Member
Re: [2005] - Display Shared Outlook Calendar in Application
Hi RobDog888,
Any luck in converting the file?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|