turning off highlighting

J

Joe

Sorry. I didn't get it. I;m using Word 2002. Does anyone know what's wrong with this code. I don't want the words " and " and "The system is able to provide 3 MB/s" to be highlighted

Any help would be greatly appreciated

Thanks

Jo

With Selectio
' Sizing summar
.TypeText "The server sizing is largely dependent on the number of simultaneous " &
"retrievals from Vericis Workstations and the number of incoming studies from " &
"modalities. The system was sized to support

.Font.Bold = Tru
.TypeText "3
.Font.Bold = Fals
.TypeText " concurrent cath sessions (30 MB/s)

.MoveLeft wdWord, 10, wdExten
.Range.HighlightColorIndex = wdRe
.Collapse wdCollapseEn
.Range.HighlightColorIndex = wdNoHighligh
.TypeText "

.TypeText " and

.Font.Bold = Tru
.TypeText "3
.Font.Bold = Fals
.TypeText " concurrent echo sessions (30 MB/s)

.MoveLeft wdWord, 10, wdExten
.Range.HighlightColorIndex = wdRe
.Collapse wdCollapseEn
.MoveRight
.Range.HighlightColorIndex = wdNoHighligh

.TypeText ". The system is able to provide
.Font.Bold = Tru
.TypeText "3
.Font.Bold = Fals
.TypeText " MB/s.
.TypeParagrap
.TypeParagrap
End With
 
D

Dave Lett

Hi Joe,

I _think_ you're looking for the following:

With Selection
' Sizing summary
sText = "The server sizing is largely dependent on the number " & _
"of simultaneous retrievals from Vericis Workstations and the " & _
"number of incoming studies from modalities. The system was " & _
"sized to support 3 concurrent cath sessions (30 MB/s) and 3 " & _
"concurrent echo sessions (30 MB/s). The system is able to provide
3 MB/s."
.Text = sText
.HomeKey unit:=wdStory
With .Find
.ClearFormatting
.Text = "<[3]>"
.MatchWildcards = True
With .Replacement
.ClearFormatting
.Text = ""
.Font.Bold = True
End With
.Execute Replace:=wdReplaceAll

.Text = "<[3]>*MB\/s\)"
With .Replacement
.ClearFormatting
.Highlight = True
End With
.Execute Replace:=wdReplaceAll
End With
End With

HTH,
Dave
Joe said:
Sorry. I didn't get it. I;m using Word 2002. Does anyone know what's
wrong with this code. I don't want the words " and " and "The system is
able to provide 3 MB/s" to be highlighted.
 
J

Joe

Dave

Thanks. This isn't doing quite what I need it to do

The first thing that I would need to change is that I don't know how many concurrent cath or echo units will be used. I also don't know how much the system will be able to provide from one report to another

Where I could probably solve these with variables, the last problem is that, when I ran it, it didn't actually highlight any text

Do you ahev any other ideas

Thanks again

Jo

----- Dave Lett wrote: ----

Hi Joe

I _think_ you're looking for the following

With Selectio
' Sizing summar
sText = "The server sizing is largely dependent on the number " &
"of simultaneous retrievals from Vericis Workstations and the " &
"number of incoming studies from modalities. The system was " &
"sized to support 3 concurrent cath sessions (30 MB/s) and 3 " &
"concurrent echo sessions (30 MB/s). The system is able to provid
3 MB/s.
.Text = sTex
.HomeKey unit:=wdStor
With .Fin
.ClearFormattin
.Text = "<[3]>
.MatchWildcards = Tru
With .Replacemen
.ClearFormattin
.Text = "
.Font.Bold = Tru
End Wit
.Execute Replace:=wdReplaceAl

.Text = "<[3]>*MB\/s\)
With .Replacemen
.ClearFormattin
.Highlight = Tru
End Wit
.Execute Replace:=wdReplaceAl
End Wit
End Wit

HTH
Dav
Joe said:
Sorry. I didn't get it. I;m using Word 2002. Does anyone know what'
wrong with this code. I don't want the words " and " and "The system i
able to provide 3 MB/s" to be highlighted
 
D

Dave Lett

Hi Joe,

This is an easy enough change:

With Selection
''' if you don't have a highlight color specified
''' then the replace operation won't highlight anything.
Options.DefaultHighlightColorIndex = wdGreen
' Sizing summary
sText = "The server sizing is largely dependent on the number "
& _
"of simultaneous retrievals from Vericis Workstations and the "
& _
"number of incoming studies from modalities. The system was "
& _
"sized to support 3 concurrent cath sessions (30 MB/s) and 3 "
& _
"concurrent echo sessions (30 MB/s). The system is able to
provide 3 MB/s."
.Text = sText
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
''' instead of finding only "3", this now finds
''' any number that is 1 or more digits long and
''' followed by "concurrent" and makes the first word
''' (the number) boldface
.Text = "<[0-9]{1,} concurrent>"
.MatchWildcards = True
Do While .Execute
Selection.Words(1).Font.Bold = True
Loop
Selection.HomeKey Unit:=wdStory
''' instead of finding only "3", this now finds
''' any number that is 1 or more digits long and
''' followed by "concurrent" and going through to
''' the text "MB/s" (therefore, the amount the
''' system can provide is a moot point)
''' it highlights this whole range in the color
''' that you specify in the second line.
.Text = "<[0-9]{1,} concurrent>*MB\/s\)"
With .Replacement
.ClearFormatting
.Highlight = True
End With
.Execute Replace:=wdReplaceAll
End With
End With

HTH,
Dave

Joe said:
Dave,

Thanks. This isn't doing quite what I need it to do.

The first thing that I would need to change is that I don't know how many
concurrent cath or echo units will be used. I also don't know how much the
system will be able to provide from one report to another.
Where I could probably solve these with variables, the last problem is
that, when I ran it, it didn't actually highlight any text.
Do you ahev any other ideas.

Thanks again,

Joe


----- Dave Lett wrote: -----

Hi Joe,

I _think_ you're looking for the following:

With Selection
' Sizing summary
sText = "The server sizing is largely dependent on the number " & _
"of simultaneous retrievals from Vericis Workstations and the " & _
"number of incoming studies from modalities. The system was " & _
"sized to support 3 concurrent cath sessions (30 MB/s) and 3 " & _
"concurrent echo sessions (30 MB/s). The system is able to provide
3 MB/s."
.Text = sText
.HomeKey unit:=wdStory
With .Find
.ClearFormatting
.Text = "<[3]>"
.MatchWildcards = True
With .Replacement
.ClearFormatting
.Text = ""
.Font.Bold = True
End With
.Execute Replace:=wdReplaceAll

.Text = "<[3]>*MB\/s\)"
With .Replacement
.ClearFormatting
.Highlight = True
End With
.Execute Replace:=wdReplaceAll
End With
End With

HTH,
Dave
Joe said:
Sorry. I didn't get it. I;m using Word 2002. Does anyone know
what's
wrong with this code. I don't want the words " and " and "The system is
able to provide 3 MB/s" to be highlighted.
' Sizing summary
.TypeText "The server sizing is largely dependent on the
number of
simultaneous " & _
"retrievals from Vericis Workstations and the number of incoming studies from " & _
"modalities. The system was sized to support "
.TypeText "3"
.Font.Bold = False
.TypeText " concurrent cath sessions (30 MB/s)"
.Range.HighlightColorIndex = wdRed
.Collapse wdCollapseEnd
.Range.HighlightColorIndex = wdNoHighlight
.TypeText " "
.TypeText "3"
.Font.Bold = False
.TypeText " concurrent echo sessions (30 MB/s)"
.Range.HighlightColorIndex = wdRed
.Collapse wdCollapseEnd
.MoveRight 1
.Range.HighlightColorIndex = wdNoHighlight
.Font.Bold = True
.TypeText "3"
.Font.Bold = False
.TypeText " MB/s."
.TypeParagraph
.TypeParagraph
End With
 
P

Peter Hewett

Hi Dave Lett

If memory serves me correctly Words Find object restricts the search and replace strings
to 255 characters.

HTH + Cheers - Peter


Hi Joe,

I _think_ you're looking for the following:

With Selection
' Sizing summary
sText = "The server sizing is largely dependent on the number " & _
"of simultaneous retrievals from Vericis Workstations and the " & _
"number of incoming studies from modalities. The system was " & _
"sized to support 3 concurrent cath sessions (30 MB/s) and 3 " & _
"concurrent echo sessions (30 MB/s). The system is able to provide
3 MB/s."
.Text = sText
.HomeKey unit:=wdStory
With .Find
.ClearFormatting
.Text = "<[3]>"
.MatchWildcards = True
With .Replacement
.ClearFormatting
.Text = ""
.Font.Bold = True
End With
.Execute Replace:=wdReplaceAll

.Text = "<[3]>*MB\/s\)"
With .Replacement
.ClearFormatting
.Highlight = True
End With
.Execute Replace:=wdReplaceAll
End With
End With

HTH,
Dave
Joe said:
Sorry. I didn't get it. I;m using Word 2002. Does anyone know what's
wrong with this code. I don't want the words " and " and "The system is
able to provide 3 MB/s" to be highlighted.
Any help would be greatly appreciated.

Thanks,

Joe

With Selection
' Sizing summary
.TypeText "The server sizing is largely dependent on the number of simultaneous " & _
"retrievals from Vericis Workstations and the number of incoming studies from " & _
"modalities. The system was sized to support "

.Font.Bold = True
.TypeText "3"
.Font.Bold = False
.TypeText " concurrent cath sessions (30 MB/s)"

.MoveLeft wdWord, 10, wdExtend
.Range.HighlightColorIndex = wdRed
.Collapse wdCollapseEnd
.Range.HighlightColorIndex = wdNoHighlight
.TypeText " "

.TypeText " and "

.Font.Bold = True
.TypeText "3"
.Font.Bold = False
.TypeText " concurrent echo sessions (30 MB/s)"

.MoveLeft wdWord, 10, wdExtend
.Range.HighlightColorIndex = wdRed
.Collapse wdCollapseEnd
.MoveRight 1
.Range.HighlightColorIndex = wdNoHighlight

.TypeText ". The system is able to provide "
.Font.Bold = True
.TypeText "3"
.Font.Bold = False
.TypeText " MB/s."
.TypeParagraph
.TypeParagraph
End With
 
D

Dave Lett

Hi Peter,

I'm sure that you're right: one cannot put a character string that is
greater than 255 characters in the .Text or .Replacement.Text property. But
I'm not sure what you're driving at in this scenario. Using wildcards, the
Find.Text can "represent" a string that is much longer. For example, I have
a document whose text is "%1(repeat this l character 5000 times)%", leaving
a document with 5002 characters. You can "find" all 5002 characters with
either of the following:

Selection.Find.Execute _
FindText:="%l@%", _
MatchWildcards:=True
Selection.Find.Execute _
FindText:="%*%", _
MatchWildcards:=True

I feel darn certain that you know all of this, so if this isn't what you're
getting at, then I'm still not sure what you're driving at.

Dave

Peter Hewett said:
Hi Dave Lett

If memory serves me correctly Words Find object restricts the search and replace strings
to 255 characters.

HTH + Cheers - Peter


Hi Joe,

I _think_ you're looking for the following:

With Selection
' Sizing summary
sText = "The server sizing is largely dependent on the number " & _
"of simultaneous retrievals from Vericis Workstations and the " & _
"number of incoming studies from modalities. The system was " & _
"sized to support 3 concurrent cath sessions (30 MB/s) and 3 " & _
"concurrent echo sessions (30 MB/s). The system is able to provide
3 MB/s."
.Text = sText
.HomeKey unit:=wdStory
With .Find
.ClearFormatting
.Text = "<[3]>"
.MatchWildcards = True
With .Replacement
.ClearFormatting
.Text = ""
.Font.Bold = True
End With
.Execute Replace:=wdReplaceAll

.Text = "<[3]>*MB\/s\)"
With .Replacement
.ClearFormatting
.Highlight = True
End With
.Execute Replace:=wdReplaceAll
End With
End With

HTH,
Dave
Joe said:
Sorry. I didn't get it. I;m using Word 2002. Does anyone know what's
wrong with this code. I don't want the words " and " and "The system is
able to provide 3 MB/s" to be highlighted.
Any help would be greatly appreciated.

Thanks,

Joe

With Selection
' Sizing summary
.TypeText "The server sizing is largely dependent on the number
of
simultaneous " & _
"retrievals from Vericis Workstations and the number of incoming studies from " & _
"modalities. The system was sized to support "

.Font.Bold = True
.TypeText "3"
.Font.Bold = False
.TypeText " concurrent cath sessions (30 MB/s)"

.MoveLeft wdWord, 10, wdExtend
.Range.HighlightColorIndex = wdRed
.Collapse wdCollapseEnd
.Range.HighlightColorIndex = wdNoHighlight
.TypeText " "

.TypeText " and "

.Font.Bold = True
.TypeText "3"
.Font.Bold = False
.TypeText " concurrent echo sessions (30 MB/s)"

.MoveLeft wdWord, 10, wdExtend
.Range.HighlightColorIndex = wdRed
.Collapse wdCollapseEnd
.MoveRight 1
.Range.HighlightColorIndex = wdNoHighlight

.TypeText ". The system is able to provide "
.Font.Bold = True
.TypeText "3"
.Font.Bold = False
.TypeText " MB/s."
.TypeParagraph
.TypeParagraph
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top