Monday 11 April 2016

Checking if a word in a Word document Paragraphs text is bold Asp.net c#



Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.OpenNoRepairDialog(FileName: Filepath, ConfirmConversions: false, ReadOnly: true, AddToRecentFiles: false, NoEncodingDialog: true);
          

Microsoft.Office.Interop.Word.Range r = doc.Paragraphs[par].Range; 

     if (r.Bold == -1)
        {
            string ptext=r.Text.Trim();

        }


/// Result

This is bold

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...