Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

import oracle ics file into outlook 2007/2010 using script

Posted on 2011-05-12
13
Medium Priority
?
1,218 Views
Last Modified: 2012-05-11
Dear experts,

we are having issues to import oracle calendar ics files into outook. Manually there is no problem to import, but programmatically this cannot be done.

We used vba (macro) from MS msdn site, but it works only for MS ics files and not from oracle ics. The MS msdn vba code for outlook is really slow for large ics files.
For us is this part of automatisation is very important. We are really stucked. If someone can help us with a full working code in vb.net (.net prefered in stead of vba) that would help us really lot.


In the attachment there is a exp of an oracle ics file. Rename from *.txt to *.ics.

Regards,

dB
 oracle.txt
0
Comment
Question by:DigitBoy
  • 7
  • 5
13 Comments
 
LVL 18

Expert Comment

by:dj_alik
ID: 35746787
You can by using Outlook com object:
for example:
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set oSharedFolder = myNamespace.OpenSharedFolder("\\path\Test.ics")
0
 
LVL 18

Expert Comment

by:dj_alik
ID: 35746801
OpenSharedFolder method is used to access the following shared folder types:

Webcal calendars (webcal://mysite/mycalendar)
RSS feeds (feed://mysite/myfeed)
Windows SharePoint Services folders (stssync://mysite/myfolder)
iCalendar calendar (.ics) files
vCard contact (.vcf) files
Outlook message (.msg) files
0
 
LVL 18

Expert Comment

by:dj_alik
ID: 35746816
The following vb.net code can however import appointments to the default calendar from a specified .ics file. The code needs more work but could provide a base for implementing the functionality.
 
Dim


 myApplication As New Outlook.Application
 

Dim myMAPInameSpace As Outlook.NameSpace = myApplication.GetNamespace("MAPI")
 

Dim ImportAppointmentFolder As Outlook.Folder
 
ImportAppointmentFolder = myMAPInameSpace.OpenSharedFolder(

"\\10.22.2.230\c$\test1.ics")
 

Dim myCalendarFolder As Outlook.Folder
 
myCalendarFolder = myMAPInameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar)
 
System.Threading.Thread.Sleep(5000)
 

For Each Item As Object In ImportAppointmentFolder.Items
 

Select Case Microsoft.VisualBasic.Information.TypeName(Item).ToLower
 

Case "appointmentitem"
 

Dim myNewObject As Outlook.AppointmentItem = myApplication.CreateItem(Outlook.OlItemType.olAppointmentItem)
 

Try
 
Item.move(myCalendarFolder)
 

Catch ex As Exception
 

'TODO
 
System.Diagnostics.Debug.WriteLine(ex.Message)
 

End Try
 

Case Else
 

'TODO
 
System.Diagnostics.Debug.WriteLine(Microsoft.VisualBasic.Information.TypeName(Item))
 

End Select
 

Next
 
ImportAppointmentFolder.Delete()
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:DigitBoy
ID: 35747307
hi dj_alik,


thanks for your reply, but the code that you've provided comes also from MS msdn. I used the vba code and this didn't work. I wrote in my description about the result.

rgs,

dB
0
 

Author Comment

by:DigitBoy
ID: 35747335
Hi dn_alik,
I put an example of an oracle ics file. Can you try at your side with this file please?

rgs,

dB
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35748995
Try the free Redemption library

http://social.msdn.microsoft.com/Forums/en/vsto/thread/4755d727-43db-4a04-8822-f0262b5d0fbb


By the way, I believe ICS is a standard calendar format so there should not be a MS ICS and an Oracle ICS.
0
 

Assisted Solution

by:DigitBoy
DigitBoy earned 0 total points
ID: 35749038
@CodeCruiser,

that is not full true. Ics has his rfc standard, but MS is slightly different from other format. If not i would not pose this question :). I found the same site few weeks ago. dj_alik his snipset code is coming from this site.
0
 

Assisted Solution

by:DigitBoy
DigitBoy earned 0 total points
ID: 35749117
Hi,


I'd be really grateful if someone could do a conversion from vba macro to vb.net "http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_23992307.html" from bluedevilfan codes (the 3 parts).

thanks in advance experts
0
 
LVL 18

Expert Comment

by:dj_alik
ID: 35749146
Please check this:
DDay.iCal - an iCalendar class library
http://sourceforge.net/projects/dday-ical/
0
 
LVL 18

Expert Comment

by:dj_alik
ID: 35749395
This MSDN articles will help you:

Converting Code from VBA to Visual Basic .NET
http://msdn.microsoft.com/en-us/library/aa192490(office.11).aspx

Convert VBA Code to Visual Basic When Migrating to Visual Studio 2005 Tools for Office  
http://msdn.microsoft.com/en-us/library/aa537180(office.11).aspx
0
 

Assisted Solution

by:DigitBoy
DigitBoy earned 0 total points
ID: 35749550
hi dj_alik,

thansk for providing the urls's, but I'm not developper I  have only small notice. is it possible for you to help me out please?
0
 

Accepted Solution

by:
DigitBoy earned 0 total points
ID: 35778527
I'm gonna pose different question in other zone. Thank all experts. the answer given by the experts didn't help me, but I will split the points.
 
0
 

Author Closing Comment

by:DigitBoy
ID: 35810079
not the answers on my question
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question