Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

Word: Loop through all the words in a Word document

 

How to examine a Word document for individual words.

This code snippet searches each word individually in a Word document.

The trick: you go through Word.Document.Words as Range objects

 

Subject:

Code example for C #, VSTO

 

 

//--< @Loop: Words >--

foreach (Range word in _doc.Words)

{

    //«KDNR»

    string sWord = word.Text;

    if (sWord.IndexOf("Test")>-1)

    {

 

 

    }

}

//--</ @Loop: Words >--

 

 

 

To go through an addin in C # you have to embed the following

using Word = Microsoft.Office.Interop.Word;

 

Mobile
»
Resize the photo and copy it to the clipboard
»
Code: Word Addin with photos resize and paste in Word
»
How to Get the Word Template or a New Word Document in VSTO Addin
»
Word Addin: Adds customer data from Excel file to Word file
»
Saving Settings in Office Addin VSTO
»
Word: Loop through all the words in a Word document
»
Load data grid in C #. Example here in WinForms, VSTO add-in

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de