How to find and replace text programmatically – MS Word

nn nWhile working with the Add – In, came across the scenarionwhere I needed to replace the text in word document programmatically, this isnhow it can be done n nFollowing code finds the word occurrence andnreplaces with the desired characters in first paragraph of the document. n nprivate voidnFindAndReplaceText(object _wordToFind, object _replaceWith) n n{ n … Read more

Word Add In Installer – Unable to read App Config

nn napp.config file is not getting read afterninstalling word add in installer? n nSolution: n nIn Installer project there is a registry key fornadd in which has manifest entry. MSDNnDocumentation says that manifest values should benset to – [TARGETDIR]YourAddIn.vsto|vstolocal , now when this is changed to filenpath like file:/// [TARGETDIR]YourAddIn.vsto|vstolocal andnreinstalling add in I got … Read more

How to set people and group column programmatically using Client Object Model

nn nusing SP = Microsoft.SharePoint.Client;nnnn n using (SP.ClientContext _ctx = new SP.ClientContext(“http://YourSiteUrl”)) n n{ n n  SP.ListItem _listItem = null; n n n n nctx.Credentials = CredentialCache.DefaultCredentials; n n  n n  SP.List _testList = web.Lists.GetByTitle(“TestList”); n n  SP.CamlQuery _query = newnSP.CamlQuery(); n   query.ViewXml = @”<View><Query><Where><Geq><FieldRef Name=’ID’/>” + “<Value Type=’Number’>10</Value></Geq></Where></Query></View>”; n n  SP.ListItemCollection _listitems =n_configList.GetItems(_query); n … Read more