views:

1144

answers:

1

I'd like to edit my Sharepoint Wiki content programmatically. One of the advantages would be to add indexes to the Wiki environment automatically.

Has anyone been able to do this? Language doesn't matter, but looking for scripting solution.

+1  A: 

A SharePoint wiki is just a special type of document library. There's just a few oddities I've run into when trying to do this.

A SharePoint wiki page consists of a template file and a list item. When you view the page, fields from the list item are inserted into the template file. So to update a wiki page, you just have to update the correct fields in the list item. (Incidentally, that also means you can't get at the original template like you could a file in a normal document library. So far, the only way I've found to get the template itself is to download it through SharePoint Designer.)

Also, SharePoint automatically renders the wiki content when you access the list item programmatically. So, I was never able to get the content that contained "[[My Link Name]]," for example--SharePoint would always return the rendered HTML instead, like:

<A class=ms-wikilink href="/MyWikiLibrary/MyLinkName.aspx">My Link Name</A>

With a little regex work you should be able to convert this back to the original wiki content, though.

DylanW
Has anyone figured out how to get the template without sharepoint designer?
C. Ross