Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Sat, 29 Apr 2006 19:37:21 +0300,    group: microsoft.public.word.vba.addins        back       


Get a style marked word/s from a paragraph   
I have some paragraphs in a word document. Looks like : 

P1 : 
XXX YYY    rest of the text

P2 : 
XXX    rest of the text

P3 : 
XXX YYY ZZZ rest of the text

P4 : 
XXX rest of the text


XXX , YYY , ZZZ are marked with  WORDNNN   style. rest of the text are normal
style. there are no any delimiter between them. 

So - i know the style's name. Can i parse , marked as WORDNNN style text ? and
get XXX ? Is it possible ?
date: Sat, 29 Apr 2006 19:37:21 +0300   author:   inpuarg

Re: Get a style marked word/s from a paragraph   
Find will retrieve text based on style.



"inpuarg"  wrote in message 
news:t65752h0kp4mr4ob45bt6o8408nf25bov8@4ax.com...
>I have some paragraphs in a word document. Looks like :
>
> P1 :
> XXX YYY    rest of the text
>
> P2 :
> XXX    rest of the text
>
> P3 :
> XXX YYY ZZZ rest of the text
>
> P4 :
> XXX rest of the text
>
>
> XXX , YYY , ZZZ are marked with  WORDNNN   style. rest of the text are 
> normal
> style. there are no any delimiter between them.
>
> So - i know the style's name. Can i parse , marked as WORDNNN style text ? 
> and
> get XXX ? Is it possible ?
>
>
date: Sun, 30 Apr 2006 02:40:52 +1000   author:   Jezebel

Re: Get a style marked word/s from a paragraph   
could you please give me more detail ? 
That FIND method  - is the method of which class ? 

Document.Find or Application.Find or Content.find or Style.Find or ? 

(by the way - i am using c# 2005 )


On Sun, 30 Apr 2006 02:40:52 +1000, "Jezebel"  wrote:

>Find will retrieve text based on style.
>
>
date: Sat, 29 Apr 2006 20:00:16 +0300   author:   inpuarg

Re: Get a style marked word/s from a paragraph   
I have only this :(



            Microsoft.Office.Interop.Word.Range c = this.Paragraphs[1].Range;


msdn sucks. no sample . no detail. nothing. 


On Sat, 29 Apr 2006 20:00:16 +0300, inpuarg  wrote:

>could you please give me more detail ? 
>That FIND method  - is the method of which class ? 
>
>Document.Find or Application.Find or Content.find or Style.Find or ? 
>
>(by the way - i am using c# 2005 )
>
>
>On Sun, 30 Apr 2006 02:40:52 +1000, "Jezebel"  wrote:
>
>>Find will retrieve text based on style.
>>
>>
date: Sat, 29 Apr 2006 20:12:23 +0300   author:   inpuarg

Re: Get a style marked word/s from a paragraph   
You need to learn how Word works before you start trying to program it. 
Sorry. That is just how it is.

Try within Word recording a macro that searches for your style and examine 
the code.

-- 
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:bp67525sgteljtv01k064e5cp9um4tp2sd@4ax.com...
> could you please give me more detail ?
> That FIND method  - is the method of which class ?
>
> Document.Find or Application.Find or Content.find or Style.Find or ?
>
> (by the way - i am using c# 2005 )
>
>
> On Sun, 30 Apr 2006 02:40:52 +1000, "Jezebel"  
> wrote:
>
>>Find will retrieve text based on style.
>>
>>
>
date: Sat, 29 Apr 2006 12:58:32 -0500   author:   Charles Kenyon

Re: Get a style marked word/s from a paragraph   
If you can't use Help to understand the Find object, your project is doomed 
from the start.



"inpuarg"  wrote in message 
news:bp67525sgteljtv01k064e5cp9um4tp2sd@4ax.com...
> could you please give me more detail ?
> That FIND method  - is the method of which class ?
>
> Document.Find or Application.Find or Content.find or Style.Find or ?
>
> (by the way - i am using c# 2005 )
>
>
> On Sun, 30 Apr 2006 02:40:52 +1000, "Jezebel"  
> wrote:
>
>>Find will retrieve text based on style.
>>
>>
>
date: Sun, 30 Apr 2006 12:04:09 +1000   author:   Jezebel

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us