Again, this newsgroup is about vba, not vb, not C.
vba's help has nice information on Find, including examples. However, it is
on the Find object, rather than a Find method.
Before trying to program Word, learn Word.
This message is posted to a newsgroup. Please post replies
from my ignorance and your wisdom.
Post by inpuargI've found the solution but not so easy.
Before chm help , or earlier version of MSDN Library , Microsoft was working
for supplying a good help document. At least for main methods , like Find method
, there was a sample.
I am using c# 2005 , VSTO2005 and related MSDN Library. There is no any sensible
explanation or sample.
public partial class ThisDocument
{
Microsoft.Office.Interop.Word.Selection activeSelection = null;
Microsoft.Office.Interop.Word.Range range = null;
private void ThisDocument_Startup(object sender, System.EventArgs e)
{
this.SelectionChange += new
Microsoft.Office.Tools.Word.SelectionEventHandler(ThisDocument_SelectionChange);
for (int i = 1; i < this.Paragraphs.Count+1; i++)
{
range = this.Paragraphs[i].Range;
range.Select();
string word = "";
string response = "";
bool ret = parseWordAndResponse(ref word, ref response);
ret = insertWordToDatabase(word, response);
}
private void ThisDocument_SelectionChange(object sender,
Microsoft.Office.Tools.Word.SelectionEventArgs e)
{
activeSelection = e.Selection;
}
C#
public interface Find
Word Primary Interop Assembly Reference
Find.Execute Method
Runs the specified find operation.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in
microsoft.office.interop.word.dll)
bool Execute(
[In, Optional] ref object FindText,
[In, Optional] ref object MatchCase,
[In, Optional] ref object MatchWholeWord,
[In, Optional] ref object MatchWildcards,
[In, Optional] ref object MatchSoundsLike,
[In, Optional] ref object MatchAllWordForms,
[In, Optional] ref object Forward,
[In, Optional] ref object Wrap,
[In, Optional] ref object Format,
[In, Optional] ref object ReplaceWith,
[In, Optional] ref object Replace,
[In, Optional] ref object MatchKashida,
[In, Optional] ref object MatchDiacritics,
[In, Optional] ref object MatchAlefHamza,
[In, Optional] ref object MatchControl
);