Selection of paragraph styles in one go 
Author Message
 Selection of paragraph styles in one go

Hi all,
In Word XP
By right clicking on a style name, and choosing "select all occurences" (I
don't know exactly how it's called in german, I have Word XP in german), you
can select all the text which is in the style wanted and delete the text, or
reapply another style...
I would like to do the same in VBA, how can I do ? (I was trying to record a
macro, it seems to me that this part is not recorded?)
Thanks in advance,
Ali


Thu, 08 Jul 2004 02:09:03 GMT  
 Selection of paragraph styles in one go
Hi, Ali,

Unfortunately, it's not possible with VBA.

According to
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q288424,

--------------
Limitations for Working with Discontiguous Selections Using the Word
Object Model

You cannot select a discontiguous range programmatically by using the
Word 2002 object model. A discontiguous selection may only be created
by the user in the Word UI.

A Range object cannot contain multiple subranges. Therefore, if the
current selection is discontiguous, Selection.Range will return the
last subrange that the user selected.
--------------

There's more, but that covers your question...

--
Regards,
Jay Freedman
Microsoft Word MVP        Word MVP FAQ site: http://www.mvps.org/word


Quote:
> Hi all,
> In Word XP
> By right clicking on a style name, and choosing "select all
occurences" (I
> don't know exactly how it's called in german, I have Word XP in
german), you
> can select all the text which is in the style wanted and delete the
text, or
> reapply another style...
> I would like to do the same in VBA, how can I do ? (I was trying to
record a
> macro, it seems to me that this part is not recorded?)
> Thanks in advance,
> Ali



Thu, 08 Jul 2004 07:29:24 GMT  
 Selection of paragraph styles in one go
Thanks Jay.
Ali.



Quote:
> Hi, Ali,

> Unfortunately, it's not possible with VBA.

> According to
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q288424,

> --------------
> Limitations for Working with Discontiguous Selections Using the Word
> Object Model

> You cannot select a discontiguous range programmatically by using the
> Word 2002 object model. A discontiguous selection may only be created
> by the user in the Word UI.

> A Range object cannot contain multiple subranges. Therefore, if the
> current selection is discontiguous, Selection.Range will return the
> last subrange that the user selected.
> --------------

> There's more, but that covers your question...

> --
> Regards,
> Jay Freedman
> Microsoft Word MVP        Word MVP FAQ site: http://www.mvps.org/word



> > Hi all,
> > In Word XP
> > By right clicking on a style name, and choosing "select all
> occurences" (I
> > don't know exactly how it's called in german, I have Word XP in
> german), you
> > can select all the text which is in the style wanted and delete the
> text, or
> > reapply another style...
> > I would like to do the same in VBA, how can I do ? (I was trying to
> record a
> > macro, it seems to me that this part is not recorded?)
> > Thanks in advance,
> > Ali



Thu, 08 Jul 2004 16:11:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Replacing all paragraph marks in a certain style EXCEPT the last one in this style

2. Reading Auto-Numbered Word Paragraph Styles in VB

3. Deleting some of the index fields (in a paragraph style)

4. Change a Style>Paragraph>line spacing value via VBA

5. Copying Styled paragraphs in Word 2000

6. Character Styles in a Paragraph

7. how to find the characters with different style in a paragraph

8. Paragraph Styles for Text in All Cells

9. IF field and numbered paragraphs with styles

10. Moving paragraphs based on style

11. number of styles used in a paragraph

12. Applying Character Style to All Except To Paragraph Mark

 

 
Powered by phpBB® Forum Software