Hi Klaus
I send you a link with this style - You will understand easier what type of
text I am searching for.
Here is the link: www.vranov-podyji.cz/temp/lorem.zip
There is only one style inside.
This is the style what I am looking for.
I don't now how to write the right conditional statement for searching and
replacing this text.
I will look Your code below.
Thank you for Your time - Jan
I am using W2007.
> Hi Jan,
>
[quoted text clipped - 73 lines]
>>
>> Thanks Jan
I found one Problem by searching the defined styles.
Please look the file:
http://vranov-podyji.cz/temp/lorem-2styles.zip
There is 2 styles:
Normal
odrazka-popis-pole
I don't know how to find the style with name "odrazka-popis-pole"
I need to join the text with styles "odrazka-popis-pole" and "Normal"(with
bullet) -> into the same style e.g. Bullets or some my style
-----
Mystery for me still is how Word deal with styles.
If I have style Normal and select this text and press Crtl+B - is it still
style Normal, but BOLD
I don't know than how to hold the same look of the text.
Mostly is it problem if I get the document from someone else than is very
hard to make a new formating.
I mean e.g. select text with Normal style - the Normal text looks
different - sometime is bold, sometime italic, but still Normal style.
Can somebody explane me how it works exactly?
Thanks

Signature
Jan Kratochvil, Office 2007, Win XP Pro SP2
> Hi Jan,
>
[quoted text clipped - 73 lines]
>>
>> Thanks Jan
Russ - 13 Aug 2007 09:05 GMT
Jan,
Here are some good links to research:
<http://www.shaunakelly.com/word/styles/TipsOnStyles.html>
<http://www.word.mvps.org/FAQs/General/FindingSpecialCharacters.htm>
<http://office.microsoft.com/en-us/word/HA011876141033.aspx>
<http://www.google.com/search?&q=paragraph+character+style+format+ingroup:wo
rd>
> I found one Problem by searching the defined styles.
>
[quoted text clipped - 26 lines]
>
> Thanks

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
Jan Kratochvil - 13 Aug 2007 14:57 GMT
Thank you very much.
I made the whole training about Word styles
Now I understand more how Word works with styles.
Very useful training - I recommend if for all users thay have stilll a
question about Word Styles - like me ;)
http://office.microsoft.com/training/Training.aspx?AssetID=RC011039261033&CTT=6&
Origin=RC011039261033

Signature
Jan Kratochvil, Office 2007, Win XP Pro SP2
> Jan,
> Here are some good links to research:
[quoted text clipped - 36 lines]
>>
>> Thanks
Graham Mayor - 13 Aug 2007 09:23 GMT
Maybe this will help? It will allow you to pick a style from those available
and replace it with another picked from those available.
Sub ReplaceStyle()
Dim FindStyle As String
Dim ReplaceStyle As String
FindInput:
MsgBox "Pick style to find", vbInformation, "Find Style"
With Dialogs(wdDialogFormatStyle)
.Display
FindStyle = .Name
End With
ReplaceInput:
MsgBox "Replace " & FindStyle & " style with which style?", _
vbInformation, "Replace Style"
With Dialogs(wdDialogFormatStyle)
.Display
ReplaceStyle = .Name
End With
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
On Error GoTo FindError
Selection.Find.Style = ActiveDocument.Styles(FindStyle)
Selection.Find.Replacement.ClearFormatting
On Error GoTo ReplaceError
Selection.Find.Replacement.Style = _
ActiveDocument.Styles(ReplaceStyle)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles(ReplaceStyle)
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = _
ActiveDocument.Styles("Default Paragraph Font")
With Selection.Find
.Text = ""
.Replacement.Text = ""
End With
Selection.Find.Execute replace:=wdReplaceAll
End
FindError:
MsgBox Prompt:=FindStyle & " Style does not exist", _
Buttons:=vbExclamation, _
Title:="Error!"
GoTo FindInput
ReplaceError:
MsgBox Prompt:=ReplaceStyle & " Style does not exist", _
Buttons:=vbExclamation, _
Title:="Error!"
GoTo ReplaceInput
End Sub

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I found one Problem by searching the defined styles.
>
[quoted text clipped - 105 lines]
>>>
>>> Thanks Jan
Klaus Linke - 13 Aug 2007 14:52 GMT
The solution I proposed first seems to work just fine.
If I go into one of the Normal style paragraphs with bullets, and "select
all 2 instances", I can then appy a bullet style (odrazka-popis-pole or some
other style).
If you want to find all paragraphs with this bullet, no matter what style is
applied, you can use something like the two code samples I gave in my first
reply, say like this:
Dim myPara As Paragraph
For Each myPara In ActiveDocument.Paragraphs
If myPara.Range.ListFormat.ListString <> "" Then
If Hex(AscW(myPara.Range.ListFormat.ListString)) = "F0D7" Then
If Selection.Range.ListFormat.ListTemplate.ListLevels(1).Font.Name =
"Symbol" Then
' next two lines just for debugging:
myPara.SelectNumber
MsgBox "Here:"
myPara.Style = ActiveDocument.Styles(wdStyleListBullet)
' ... or apply some other of your styles
End If
End If
End If
Next myPara
> Mystery for me still is how Word deal with styles.
>
> If I have style Normal and select this text and press Crtl+B - is it still
> style Normal, but BOLD
The "bold" is then applied on top of the style as manual formatting...
something that should be avoided.
An occasional bold or italic word is ok, but applying some manual formatting
to the whole document or a whole paragraph isn't usually a good idea.
> I don't know than how to hold the same look of the text.
> Mostly is it problem if I get the document from someone else than is very
> hard to make a new formating.
> I mean e.g. select text with Normal style - the Normal text looks
> different - sometime is bold, sometime italic, but still Normal style.
The docs almost certainly contain lots of manual formatting. Sometimes it's
best to remove all manual paragraph formatting (ResetPara = Ctrl+Q) and font
formatting (Ctrl+Spacebar), and then apply proper paragraph (and possibly
character, list and table) styles.
Or in newer versions of Word, you can use the "styles and formatting" pane.
Turn on "Keep track of formatting" (Tools > Options > Edit), and you see all
the types of manual formatting that have been applied (... visible in the
pane by the missing symbol, ¶ or ª). Use "Select all # instances" again, and
apply a proper style.
Regards,
Klaus