Thursday, December 8, 2011

A Project Item with the following item ID could not be found

In SharePoint 2010, this error may occur.

it happens when you delete/exclude any item in sharepoint project.

The solution is :-  goto the feature(mentioned in the error in visual studio)  try to find the problematic file.

The file will be identified easily. just remove that file from the "Items in the future"  section.

the problem will be solved. (it worked for me)


happy coding.....:-)










Word experienced an error trying to open the file

Thanks to author @ http://blog.techgalaxy.net/archives/3042

the problem is occurred while opening doc file (created in 2007) in office 2010.

the trick to open the file is


  1. Open Word 2010.
  2. Click File, Options, Trust Center, Trust Center Settings.
  3. Select the Protect View option.
  4. Deselect all the Protected View options. You may not have to disable Data Execution Prevention mode. Experiment with the various options until you get the results.

Tuesday, December 6, 2011

Monday, November 21, 2011

SharePoint Get list item parent folder

thanks to author @ http://blogs.tamtam.nl/appie/2009/02/23/Getting+ParentFolder+From+A+Custom+List.aspx

we can use the following method to get parent folder of listitem


static SPFolder GetParentFolder(SPListItem itemToFind, SPFolder folder)
{
      SPQuery query = new SPQuery();
      query.Folder = folder;
      SPListItemCollection items = itemToFind.ParentList.GetItems(query);
     
      foreach (SPListItem item in items)
      {
            if (item.ID == itemToFind.ID)
            {
                  return (folder);
            }
            if (item.Folder != null)
            {
                  SPFolder resultFolder = GetParentFolder(itemToFind, item.Folder);
                  if (resultFolder != null)
                  {
                        return (resultFolder);
                  }
            }
      }

      return (null);
}


So adding that function allows you to get a parentfolder with:

SPFolder parentFolder = GetParentFolder(item, null);







Thursday, November 17, 2011

Get only folders from SharePoint list

thanks to author @ http://www.ktskumar.com/blog/2009/07/retrieve-all-folders-from-list/


the trick is FSObjtype=1.
Use this while querying the list

query.Query = “<Where><Eq><FieldRef Name=’FSObjType’/><Value Type=’Lookup’>1</Value></Eq></Where>”


Monday, November 14, 2011

SharePoint 2010 Empty Recycle Bin


Thanks to author @

http://dhireny.blogspot.com/2010/06/empty-all-items-from-sharepoint-recycle.html#!/2010/06/empty-all-items-from-sharepoint-recycle.html

the trick is
goto recylebin page, then paste this in addressbar textbox in browser

javascript:emptyItems();


then press enter, thats it









SharePoint 2010 + webpart page with quick launch

thanks to author @ http://pscave.blogspot.com/2010/10/show-quick-launch-on-sharepoint-2010.html

the steps are

Delete the following from your webpart page

1.
         < asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>

2.
< asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>

3.
< style type="text/css">
body #s4-leftpanel {
display:none;
}
.s4-ca {
margin-left:0px;
}
</style>