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

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...