views:

498

answers:

2

Hello Guys,

We need to read and write the objects in SharePoint, such as the appointments (events) in SharePoint, from Delphi, what's the best/easiest way to do it? Any advises are appreciated! Thank you.

+1  A: 

The usual way is to refer to the MSDN documentation at http://msdn.microsoft.com/en-us/library/bb931736.aspx.

In Delphi, you then go to Component menu, Import component and then choose type library. Microsoft Sharepoint should be listed, but if it is not you can browse to find the client library. For Office 2007, that folder is C:\Program Files\Microsoft Office\Office12\OWSSUPP.DLL.

This will create a unit that contains definitions for all the Sharepoint interfaces and CoClasses. You would typically start of with one of the CoClasses, like CoMyStuff.Create to create an object that implements the MyStuff interface. Then follow the MSDN documentation to do what you want.

Cobus Kruger
+1  A: 

If you are able to use .NET references in Delphi and can develop on a SharePoint server then use the SharePoint Object Model. This is the most powerful way of working with SharePoint. Add a reference to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll. The object model has its pain points to be aware of however and can have a bit of a steep learning curve in some areas. Take note of the need to dispose of partially unmanaged objects such as SPSite and SPWeb if you take this route.

Alternatively use the SharePoint web services. These are quite simple and work well once you get their syntax correct. If your code cannot be deployed to the SharePoint server then they are your only option. The downside is that they are significantly reduced in functionality compared to the object model. You will certainly run up against this sooner or later which is why I recommend starting with the object model if possible.

Alex Angas
Thank you Alex, the Web services interface seems to be the way to go!
Edwin