Click here to Skip to main content
15,891,951 members
Home / Discussions / C#
   

C#

 
AnswerRe: Fire a C# Event/Delegate in C++, or: EventHandling via DLL Pin
DaveyM6910-Oct-11 7:09
professionalDaveyM6910-Oct-11 7:09 
GeneralRe: Fire a C# Event/Delegate in C++, or: EventHandling via DLL Pin
Tonkpils13-Oct-11 4:37
Tonkpils13-Oct-11 4:37 
AnswerRe: Fire a C# Event/Delegate in C++, or: EventHandling via DLL Pin
TheGreatAndPowerfulOz10-Oct-11 12:13
TheGreatAndPowerfulOz10-Oct-11 12:13 
GeneralRe: Fire a C# Event/Delegate in C++, or: EventHandling via DLL Pin
Tonkpils11-Oct-11 1:01
Tonkpils11-Oct-11 1:01 
GeneralRe: Fire a C# Event/Delegate in C++, or: EventHandling via DLL Pin
TheGreatAndPowerfulOz14-Oct-11 4:51
TheGreatAndPowerfulOz14-Oct-11 4:51 
GeneralRe: Fire a C# Event/Delegate in C++, or: EventHandling via DLL Pin
Tonkpils18-Oct-11 0:17
Tonkpils18-Oct-11 0:17 
GeneralRe: Fire a C# Event/Delegate in C++, or: EventHandling via DLL Pin
TheGreatAndPowerfulOz18-Oct-11 8:23
TheGreatAndPowerfulOz18-Oct-11 8:23 
QuestionHow to highlight all occurrences of a word in a Word document?? Pin
fiaolle10-Oct-11 4:20
fiaolle10-Oct-11 4:20 
Hi
I want to highlight or more like select all the occurrences of a word. But I have googled a lot and haven't found anything about that.
When I have tried, it just selects one appearance of the word, the last.
C#
Word.Application ap = new Word.Application();
doc = ap.Documents.Open(path, ReadOnly: false, Visible: true);
ap.Selection.Find.ClearFormatting();
ap.Selection.Find.Text = txtFind.Text;
ap.Selection.Find.Execute();
while (ap.Selection.Find.Found)
{
    ap.Selection.Select();
    ap.Selection.Find.Execute();
}
doc.Activate();
ap.Visible = true;
ap.ActiveWindow.SetFocus();

I have tried so many different approaches, but haven't been able to solve it.
I don't want to highlight the words, I just want them to be selected as they are when you choose find all in Microft Word.

Hope somebody can help me.

Many thanks
Fia
AnswerRe: How to highlight all occurrences of a word in a Word document?? Pin
Pete O'Hanlon10-Oct-11 4:52
mvePete O'Hanlon10-Oct-11 4:52 
GeneralRe: How to highlight all occurrences of a word in a Word document?? Pin
fiaolle10-Oct-11 5:08
fiaolle10-Oct-11 5:08 
GeneralRe: How to highlight all occurrences of a word in a Word document?? Pin
Pete O'Hanlon10-Oct-11 5:19
mvePete O'Hanlon10-Oct-11 5:19 
GeneralRe: How to highlight all occurrences of a word in a Word document?? Pin
fiaolle10-Oct-11 6:25
fiaolle10-Oct-11 6:25 
GeneralRe: How to highlight all occurrences of a word in a Word document?? Pin
Shameel11-Oct-11 0:32
professionalShameel11-Oct-11 0:32 
AnswerRe: How to highlight all occurrences of a word in a Word document?? Pin
jschell10-Oct-11 8:08
jschell10-Oct-11 8:08 
GeneralRe: How to highlight all occurrences of a word in a Word document?? Pin
fiaolle10-Oct-11 9:07
fiaolle10-Oct-11 9:07 
QuestionIs there a way to run nunit Test class 50 times in a loop ? Pin
Subin Mavunkal10-Oct-11 0:59
Subin Mavunkal10-Oct-11 0:59 
AnswerRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
Pete O'Hanlon10-Oct-11 1:14
mvePete O'Hanlon10-Oct-11 1:14 
GeneralRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
Subin Mavunkal10-Oct-11 1:24
Subin Mavunkal10-Oct-11 1:24 
GeneralRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
Pete O'Hanlon10-Oct-11 1:25
mvePete O'Hanlon10-Oct-11 1:25 
GeneralRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
Subin Mavunkal10-Oct-11 2:47
Subin Mavunkal10-Oct-11 2:47 
GeneralRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
Pete O'Hanlon10-Oct-11 3:07
mvePete O'Hanlon10-Oct-11 3:07 
AnswerRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
buchstaben10-Oct-11 3:20
buchstaben10-Oct-11 3:20 
GeneralRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
Pete O'Hanlon10-Oct-11 3:41
mvePete O'Hanlon10-Oct-11 3:41 
GeneralRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
buchstaben10-Oct-11 3:49
buchstaben10-Oct-11 3:49 
AnswerRe: Is there a way to run nunit Test class 50 times in a loop ? Pin
jschell10-Oct-11 8:13
jschell10-Oct-11 8:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.