Accessing SharePoint Lists with Visual Basic for Applications

SharePoint LogoSharePoint has many useful integration points with Microsoft Office out-of-the-box, but for truly deep integration you have to roll-up your sleeves and dig into some code. While there are multiple methods to do this, one of the most versatile is leveraging SharePoint’s many web services directly via Visual Basic for Applications. For those, like me, that lack SharePoint Designer access, this is often the only method available.

This method can be used in any application that supports VBA. This includes all the standard MS Office applications – Word, Excel and PowerPoint – but also other applications such as my favorite drawing suite, CorelDraw, or Autodesk AutoCAD. These examples were developed against SharePoint 2010 and MS Office 2010, but should also work in the 2007 and 2013 versions.

Read more of this post

Announcing DP_SharePoint

SharePoint LogoI’ve published the initial version of my JavaScript library, DP_SharePoint, designed to make working with client-side SharePoint development easier.  Still in development, the library provides:

  • Methods to acquire JavaScript handlers to SharePoint form controls and fields. This make it much simpler to interrogate or add event handlers to SharePoint forms.
  • Simple methods to add or remove events from SharePoint form elements.
  • Simple methods to hide and show elements of SharePoint forms.
  • Methods to simplify the calling and use of SharePoint web services and ready the data returned from them for use.

The library should be considered (very) beta but I am using it in a heavily trafficked production development.  I’ve got lots of plans for this, as I’m in a position to do a lot of SharePoint development over the next few months or years (all without access to SharePoint Designer or any back-end support).

Comments, criticisms or suggestions are always welcome!

Get List and View Indentifiers in SharePoint

SharePoint LogoThose, like me, that put in the position of managing a SharePoint Team Site without SharePoint Designer access (or indeed without the ability to install development software of any kind) are forced to get creative sometimes.  Leveraging the many rich (but annoying inscrutable) web services available offers a lot of interesting possibilities but adds significant challenges.  Most people will start with getting data from lists.

Read more of this post

Adding Events to SharePoint Fields

SharePoint Logo[This article should be considered deprecated.  The code represented has been improved, extended and made available as the DP_SharePoint Function Library.  All future effort will be applied there.]

The first article in this series dealt with obtaining a reference to a SharePoint field in Add and Edit forms.  One of the most common reasons to head down this path is to add custom validation to fields.  Often this requires adding events to (in the case of most fields) the onchange or (in the case of buttons) the onclick events of the fields.  Simply setting the event handler directly would work, but will eliminate any currently enabled handlers (such as those defined internally to SharePoint).

Instead I created two functions to abstract the standardized addEventListener() and (for older IE browsers) the attachEvent() methods.  They accept a reference to an HTML element (in this case a SharePoint form field), an event type and a function name to call when the event is fired.  The first adds an event to the passed element and the second (which is included for balance but which I’ve honestly never actually used) removes it.

Read more of this post

Obtaining a JavaScript Reference to a SharePoint Field

SharePoint Logo[This article should be considered deprecated.  The code represented has been improved, extended and made available as the DP_SharePoint Function Library.  All future effort will be applied there.]

I’ve been digging further and further into the bowels of SharePoint.  It’s not a pleasant place to dig.  At my company end-users and team-site owners are prohibited from doing any back-end development.  Additionally, due to various political issues, there are currently no available processes to contract for such work (although you can be added to an ever-growing waiting list).  The only development path open to site owners is client-side JavaScript.

On the team-site I manage one of the most used features is a custom list cataloging enterprise Incidents managed by the team.  Each incident is logged with information about the applications affected, the team engagement times and many other pieces of information.  The list feeds business customer reports and generates performance metrics for upper management.  With over 20 people on the team the quality of information can be rather shaky.  It would benefit greatly from some simple validation and a few points of automation.

Read more of this post

Formatting Excel Links for Import into SharePoint Lists

SharePoint LogoSpent way too long figuring this out today and thought I’d do an entry so that I’d remember it.  To set the stage my team manages emergency situations and restoration of service for over 800 enterprise applications.  As you might expect we have a SharePoint list of these applications with basic information about them.

One of the values is a unique enterprise-wide code that we’ll call the “AppCode”. One of the first things we do when a problem is reported is find that AppCode code for the application and search the system of record for detailed information about the application, the support, ownership, etc.  This isn’t difficult but it does take precious seconds.  Instead my plan was to create a link directly to the application profile in our list.

Read more of this post