Get Custom Document Properties / Document Information Panel Values using C#

Object: To retrieve custom document properties of office documents using C#.
Generally, it is required to get or set custom document properties programmatically. For example, when document is checked out from sharepoint server then document information panel shows server properties. Our object is to modify the properties using C# in word. But problem is document type. Before office 2007, the document is binary file and in Office 2007, it is compressed XML file. Here is the sample code to do this. In the code, all the properties name are passed as hashtable keys.

Managing custom task panes across multiple documents in shared add in for office 2007 using .NET

I see a lot of articles on this topic but all are related to VSTO. But I required this for shared addin. I followed MSDN to create custom task pane using shared addin. It works fine but when multiple documents are opened then it appears only for the first document. I have implemented to show document wise custom task pane.

Database Installation using VS setup

Database installation is common task in setup programming.Here are the steps to install sql server database with setup using custom action. the summary is following

Add/Remove Assembly to WSP (VSEWSS)

I was facing a problem to add an assembly in VSEWSS generated WSP. I added assembly in “manifest.xml” but it is refreshed during packaging. I added assembly in VS but it was not included in WSP. There is no direct way to access ddf in VSEWSS. At Last, I got solution:

Dynamic multiline label with custom font in UITableViewController

Suppose you need to show long text in tableview cell with custom font then height is the major issue. See following steps to do this:
1. Download FontLabel app source from
http://github.com/zynga/FontLabel
It has a good library with sample to use custom fonts embedded with project. Add FontLabel library to your project.

Show UIImagePickerController from UITableViewController in iPhone

Suppose you need to show UIImagePickerController on cell click of UITableViewController class. Then
1. define UIImagePickerControllerDelegate in the header class.
2. Put following code for the cell index of didSelectRowAtIndexPath method

Resize Image to scale for a given max dimension in iphone

Generally , It is required to resize image for a given max size. the ratio of the image width and height is called Aspect ratio. If resized image aspect ratio is different from original image then it is distorted. So, It is required to resize the image in such a way that it must be in the given max size keeping same aspect ratio.

Search Engine style paging in asp.net(C#)

When a large number of records are to be displayed and total number of records is variable in nature then search engine style paging is the best approach. For a search query, we need to pass start record number and page size for paging. In the most search engine, the start index is passed using querystring.
See following, Google uses “start” query string parameter.

Reload Table View with different values iPhone

Sometimes, It is required to use same tableviewcontroller multiple times with different parameters. For example, in a game, we need to show same screen with different elements. Here, our object is to reuse UITableViewController with different parameters and it will be happened on navigation next button click.
Here are the simple steps to do this:

Set div’s all anchor tags onclick event using javascript

Here is an example to set all child anchor tags onclick event.
A div (id str1) has 3 anchor tags (First, Second and Third). When user clicks on any link, it should call “ShowValue” javascript method which displays text of that link. We have to set onclick event dynamically using javascript. See following for this:

Default view metadata(columns) in sharepoint custom search result page

Generally, it is required to search in a document library and display default view columns in search result. I read different articles for this. I like this article and updated for MOSS 2007.
There are following steps in the code:

Generate random order of series in iphone

Generally, it is required to show something in random order in series such a way that each item must be selected at one time. For example, In a Quiz application, you need to show all questions in random order and each question must be selected and not more than once. For this, use following method:

SPContext.Current.Site = NullReferenceException for asp.net page in sharepoint

To run asp.net application in the SharePoint context, it should be copied into the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS directory. If it belongs to different box then SPContext.Current.Site will not work. If ASP.net page is opened from SharePoint context then try following: