/// <summary> /// Replaces author name in document using custom ReplaceHandler /// </summary> public static void ReplaceAuthorName(string filePath) { try { //ExStart:ReplaceAuthorName // initialize custom handler, send output path using constructor IReplaceHandler <MetadataProperty> replaceHandler = new AuthorReplaceHandler(Common.MapDestinationFilePath(filePath)); // replace author int affectedPropertiesCount = SearchFacade.ReplaceInDocument(Common.MapSourceFilePath(filePath), replaceHandler); //ExEnd:ReplaceAuthorName } catch (Exception exp) { Console.WriteLine("Exception occurred: " + exp.Message); } }
/// <summary> /// Replaces author name in document using custom ReplaceHandler /// </summary> public static void ReplaceAuthorName(string filePath) { try { //ExStart:ReplaceAuthorName // initialize custom handler, send output path using constructor IReplaceHandler<MetadataProperty> replaceHandler = new AuthorReplaceHandler(Common.MapDestinationFilePath(filePath)); // replace author int affectedPropertiesCount = SearchFacade.ReplaceInDocument(Common.MapSourceFilePath(filePath), replaceHandler); //ExEnd:ReplaceAuthorName } catch (Exception exp) { Console.WriteLine("Exception occurred: " + exp.Message); } }