SharePoint 2007 (MOSS/WSS) – Adding header and footer in Word Document (.docx) with ItemAdded Event Receiver using OpenXML

I used OpenXML to add the two metadata column values – document name as the header and modified date as footer while someone upload a document in document library. Please include a reference of  WindowsBase and DocumentFormat.OpenXml in the project. WindowsBase is included in .Net framework 3.0/3.5 and you have to download DocumentFormat.OpenXml separately. Here…


SharePoint 2007 (MOSS/WSS) – Custom CAPTCHA (Antispam) Field

I saw a nice post in CodeProject ( regarding CAPTCHA image control. I used the same code to create a Custom Field that will work like a CAPTCHA field for SharePoint. I tested it with Custom List and Blog Post suceessfully. You need to enable the session in the Web.Config file using enableSessionState=”true” as it…


SharePoint 2007 (MOSS/WSS) – how to remove "Download a Copy" context menu from a Document Library

One of my friend and colleague asked me this question. I found it tricky and a good post for my blog. Here is what you have to do: Go to your 12 hive\TEMPLATE\LAYOUTS\1033 folder. Open up the Core.js file. Find the function AddSendSubMenu. Go to the last 3 lines:             strAction = “STSNavigate(‘” + ctx.HttpRoot…


SharePoint 2007 (MOSS/WSS) using Lists.asmx – GetListItems

Requirement: I have a custom desktop application and I have created an installer for it. During installation it needs to connect trough Internet to receive the key. Now I have stored these keys in a SharePoint List as given below: The user will provide the Activation Key and Registration Number and will receive the Unlock…


Convert Office Documents (.docx, .pptx, .pub) into PDF Programmatically

Office 2007 has an option to convert different types of Documents into PDF or XPS. You can download the add-in from this location: You can convert an existing word document or other office files to PDF or XPS by choosing Save As>PDF or XPS. We also can convert documents to PDF (or XPS) programmatically….


SharePoint 2007 (MOSS/WSS) – How to add a new column (Custom BDC Column) in Discussion Board (Part2) – Step by Step

Requirement: This is an enhancement of the List Definition project we have created in previous post (SharePoint 2007 (MOSS/WSS) – How to add a new column in Discussion Board showing the Latest Thread for each Discussion – Step by Step). The new requirement is: I want to add new column that will fetch data from…


SharePoint 2007 (MOSS/WSS) – How to add a new column in Discussion Board showing the Latest Thread for each Discussion – Step by Step

Step 1: Start VS 2008 and select Visual C# > SharePoint. Select List Definition as the project template. Rename the project as CustomDiscussionBoard and click OK. In the List Definition Setting dialog box click OK. Step 2: In the solution explorer delete the ListDefinition1 folder and right click on the project and choose Add>New Item>List…


Part 2 – Adding user control to SharePoint 2007 (MOSS/WSS) Web Part and handling events in there – Step by Step with task pane properties

Since my post “Adding user control to SharePoint 2007 (MOSS/WSS) Web Part and handling events in there” I got great response and several feedbacks. I am adding a new step by step process using VS 2008 (VSeWSS 1.2). I have also used properties for the Web Part which can be set from the Web Part…


SharePoint 2007 – Step by Step Creating Custom List Definition and Custom Content Type using VS 2008 (VSeWSS 1.2)

Project Requirement: Contoso Inc. is a BPO organization working on Medical Transcription. Information workers listen to the voice recordings and create text files based on those recordings. 3 Text files (test.txt, test2.txt, test3.txt) are given as sample. IT department of Contoso Inc. has implemented MOSS 2007 for their document management and back office solution. CTO…


Removing OLE Header from images stored in MS Access DB as OLE Object

This is the first non-SharePoint blog post I am writingJ. I am writing because this is interesting and it seems lots of people faced or facing similar issues.  If you are storing images in Access DB table as OLE object, and you are adding images programmatically (for example uploading images from an aspx page), then…