.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Create ActivityEvent Programmatically by Non Admin

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :SharePoint

I am trying to create a Custom Activity Application to get activity feeds from a Sharepoint List  . And on Event Receivers  create Activity event  . Problem with this approach is ActivityEvent.CreateActivityEvent only works for Admin Users . Is there a way non admins can create activity events?


Thanks in advance


View Complete Post

More Related Resource Links

Programmatically create an InfoPath form


I'm programmatically creating an InfoPath form using this article: http://www.bizsupportonline.net/infopath2007/programmatically-create-infopath-form-console-app.htm.


Everything works well up to 29 fields (my:field1 ... my:field29). After that it runs without an error and posts a form to the library however the icon does not switch to an infopath icon and the filename stays blanks. I don't believe this field specific, it seems to be happening when I use any 29 to 30 fields so I'm thinking its a memory issue with the stream reader.

Has anybody every had this issue before, is there a way to fix this?


VS2008 and C#: How to create PictureBox controls programmatically in a FlowLayoutPanel ?

I am trying to create multiple PictureBox controls in a FlowLayoutPanel programmatically. The number of the PictureBox controls is dynamic depending on the target image folder. My current approach results a compilation error:             // (Works !)             pictureBox1 = new System.Windows.Forms.PictureBox();             pictureBox1.Width = 150;             pictureBox1.Height = 150;             flowLayoutPanel.Controls.Add(pictureBox1);             string sFileFullName = "Resources\\file1.bmp";             pictureBox1.Image = Image.FromFile(@sFileFullName);             // (Error !)             string pbName = "pictureBox";             for (int i = 0; i < 100; i++)             {             

how to create site collection by using custom template through programmatically?

hi all, how we can create site collection by using custom template through programmatically? please give me some suggestions. where we need to save this custom template... thanks in advance..

is there any problem if i create a site collection through programmatically which web application ha

hi all, My web application have 2  types of authentication -- for internal users (windows authentication) and external users (Form based authentication). I am creating site collections through programmatically in the web application. so this site collection should have the permission as form based authentication for external users and windows authentication for internal users. is it possible are not? please give me some suggestions on creating site collections which have form based authentication and windows authentication. thanks in advance......

how to create site collection by using custom template through programmatically?

hi all, how we can create site collection by using custom template through programmatically? please give me some suggestions. where we need to save this custom template... thanks in advance..

How to create a workflow programmatically?

Are there any samples that would show how to create and/or modify a workflow programmatically, i.e. from a program, not from VS.NET IDE or a hosted designer? For example, the program would create a new workflow, add a couple of activities to it, and save the serialized workflow definition (in a file or database). I can find examples explaining how to modify a workflow instance at run time, but I need to create a workflow definition, not the instance. Any hints? Thanks.Alek

Create list column, if column does not exist programmatically

Hi, I want to create a column in  the list programmatically. I tried this, and it created the column. But I would like to check if the list column already exist and if column does not exist, would like to create the column. How to check if a list column exists and if it does not exist, create the list column. I have used this code: [CODE] SPList MyList; MyList = currentweb.Lists[Constants.listname]; MyList.Fields.Add("FilesCount", SPFieldType.Number, false); MyList.DefaultView.ViewFields.Add("FilesCount"); MyList.DefaultView.Update(); [/CODE] Thank you

need help on programmatically adding .pdf file type to File Type list in Search Admin


This is easily done in the GUI but how do I program this?

I looked here - http://msdn.microsoft.com/en-us/library/ms562090(v=office.12).aspx and they just say - Extensions are grouped within an ExtensionCollection object. Use the Create method to specify a new file name extension.

Great but how do I do that - I'm not a coder and I need some pointers

I loaded the sharepoint assemblies:

[System.Reflection.Assembly]::Load("Microsoft.Office.Server.Search, Version=, Culture=neutral,

[System.Reflection.Assembly]::Load("Microsoft.Sharepoint, Version=, Culture=neutral,

[System.Reflection.Assembly]::Load("Microsoft.Office.Server, Version=, Culture=neutral,

Where do I go from here?




Programmatically activating an admin-approved form template to a site collection?



I am currently programmatically generating infopath forms with code-behind, and for each generated form, I need to be able to host the form template as a content type. Since I have a farm solution, I know that I would usually have to publish manually to admin-approved form template as opposed to form libraries or content types directly and afterwards create content types which reference those form templates. I was wondering what I would need to do to achieve the following results:

1) Programmatically activate a form template to a site collection (this is the big question mark for me)

2) Programmatically generate a content type which references said form template (I believe I already have this part down using the SP Object Model)

The environment I am building in uses SharePoint 2010 Enterprise Edition, InfoPath2010, .NET 3.5, VS 2010.

Any assistance would be MUCH appreciated.

Site Collection Admin Unable to create subsite


Hi All,

We are running into a wierd kind of problem, we had a site called A, A had to be split for two different user base so A was exported into B. Now we have two sites A & B with its own user groups.

Site collection admins of B are not able to create subsites in B. But site collection Admins of both A & B are able to create subsites in either sites.

if site collection admin of  B is given read/write control on Site A then he is able to create sites in B (totally wierd)

Can anybody help me identifying what is happening here and points to start our troubleshooting.  

Thanks in Advance,



Programmatically create a package... in silverlight?


I've succesfully managed to programmatically create and alter packages, but now I was wondering if it would be possible to do this in a fancy Silverlight 4 application.

Because you can't reference the Microsoft.SQLServer.ManagedDTS.dll assembly in Silverlight, I tried the AutomationFactory.CreateObject("ProgId") approach.

That's where I got stuck. What's the progid, and is this actually possible?

SlideLibrary programmatically create folder



I have created a workflow in visual studio 2010 for a slide library when i upload new slides that they get in a folder, if the folder doesn't excist the workflow will automatically create the folder and move the uploaded slide to the folder. I have a custom field "Folder name" that i use to enter a folder name where i can store the slides that i have uploaded.

The code that i use:

 SPListItem item = null;
 SPWeb web = null;
 string folderName = string.Empty;

 web = workflowProperties.Web;
 item = workflowProperties.Item;
 var name = item.Name.ToString();

      folderName = (string)item["Folder name"];
      if (folderName != string.Empty && folderName != null)

        SPFolder root = workflowProperties.List.RootFolder;

        string slideFolderUrl = SPUrlUtility.CombineUrl(root.ServerRelativeUrl, folderName);
        SPFolder slideFolder = web.GetFolder(slideFolderUrl);


Programmatically create publishing page and fill with content.


I have a bunch of HTML which has been exported from a different platform.
This HTML could be located in a database or contained within an HTML file. 

I am looking for some guidance on the best way to programmatically create a publishing page in SharePoint at a specific site location, then populating the RichHtmlField Publishing Web Control (PublishingPageContent) with the HTML that has been exported from one of the sources mentioned above.

Any suggestions/advice you can offer will be much appreciated.


SharePoint 2010 Central Admin--Create/Extend Web Application button on Ribbon are disabled


My Dev Environment is  SharePoint 2010 on WIN 7. I have 2 users

1) Built in Administrator- Member of FARM Administrator

2) Dinesh02\Dd – Also member of FARM Administrator

Now when I Sign-in with my account and use Manage Web Application link, on the Top Ribbon none of Button is enabled. I can not create Web APP nor Extend it.  When I select web application from list, some button are enabled but not all. Also I can see role as Contributor

This does not happen When I sign-in with Built-in\Administrator account.

create page with default template from master page programmatically


hi, exactly like cms , i want to create page programmatically with this options:

1: page-name

2: add template (master-page)

and etc...

help me .thanks

Programmatically create a web part page in wss 3.0?

I understand how to create a web part page using sharepoint's nifty UI....i.e.:

- go to site actions > create > web part page

- On the 'New Web Part Page' form: give it a name, select a 'layout template', and choose a document library for it to go into to...then click create.

- On the 'edit mode' form for you new web part page: add web parts and select the appropriate options for each web part.

I need to do all of and exactly this....however I need to do it programmatically as a part of a sharepoint application page (in the code behind the application page, obviously)...in WSS 3.0.

I understand that it's possible to do this as a feature that can be added to a sharepoint site (haven't looked at the details here tho).

This doesn't work for me cuz the web part page needs to be generated dynamically (due to the fact that document libraries get generated dynamically). For context: I'm building a web part page the has several related lists (of various sorts) on one page.

Seems like this wouldn't be that uncommon a thing to do, but haven't seen anything written up about it. Is there something written that I've missed? Or does anyone have any helpful suggestions/hints for me?

thanks very much

Who will create Super admin account?


On admin side how to create first secure admin account when there is no users/admin exists  without manuall entry ?

On any website how we can create Super admin account who will handle all the things? Except the entry in db manually. I c# or vb.net




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend