|
|
|
date: Sat, 29 Apr 2006 19:37:21 +0300,
group: microsoft.public.word.vba.addins
back
Re: Get a style marked word/s from a paragraph
I'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
);
date: Mon, 01 May 2006 11:48:27 +0300
author: inpuarg
Re: Get a style marked word/s from a paragraph
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.
--
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"inpuarg" wrote in message
news:4dib525fbbajhs5tncc1gdk7jlikj6ar4g@4ax.com...
> I'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
> );
>
>
date: Mon, 1 May 2006 10:15:08 -0500
author: Charles Kenyon
Re: Get a style marked word/s from a paragraph
i know word. i don 't have to learn vba. i am programming c#.
if vba has a good documentation this is good for you.
i am simply demanging the same :)
my only mistake was sending this issue to this group . that 's all .
i even don 't have to know word. if you want developers to improve your product
with some add-ins , macros , you have to provide a good documentation. and in
msdn .net help theese are not provided. that was all that i 'm critizing.
On Mon, 1 May 2006 10:15:08 -0500, "Charles Kenyon"
wrote:
>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.
date: Wed, 10 May 2006 15:41:26 +0300
author: inpuarg
|
|