Archive | May, 2009

DisableEventFiring() or EnableEventFiring() programmatically on a List or Document Library from anywhere


The credit for figuring this out goes to Paul and here is the original blog http://unclepaul84.blogspot.com/2007/12/disable-event-firing-in-sharepoint-when.html I had used in workflows and application page without any issues in past 6 months… If you need to disable event firing in sharepoint from anywhere except event handler and would like to .DisableEventFiring() or .EnableEventFiring() bcoz its available […]

Modify fields of an InfoPath Form Programmatically


1: const string _InfoPathTemplateLocation = @”http://moss2007/ctype/myFormLibrary/FormServerTemplates/myForm.xsn”; 2: const string _InfoPathPI_mso_infoPathSolution = “name=”urn:schemas-microsoft-com:office:infopath:myForm:-myXSD-2008-08-07T17-35-58″ solutionVersion=”1.0.0.316″ productVersion=”12.0.0.0″ PIVersion=”1.0.0.0″ href=”” 3: + _InfoPathTemplateLocation + “””; 4: const string _InfoPathPI_mso_application = “progid=”InfoPath.Document” versionProgid=”InfoPath.Document.2″ />”; 5: const string _InfoPathPI_mso_infoPath_file_attachment_present = “”; 6:  7: private void createmyForm() 8: { 9:  10: MemoryStream msSr = new MemoryStream(); 11:  12: xmlTextWriter = new XmlTextWriter(msSr, […]