Hidden text does not let the paragraph wrap up to the next line

F

frogman

WindowsXP pro
Word 2002

here is the problem:
numbers indicate what paragraph i am talking about

[ start of a choise
] end of a choise

1 and 3 are choises you can have either paragraph 1 or 3 but not both.

2 is a specifier table that is hidden with the paragraph symbol below
it when the final macro is run.

when 1 is hidden and the final macro is run 3 does not wrap back to
where paragraph 1 is.

Text:
Closure Pieces Rubber and Concrete Joints. 1[Shop fabricated closure
pieces are not required for pipe with rubber and concrete joints.
Closure pieces shall be cut in the field after the pipe, fittings, and
specials indicated on the drawings have been installed. The alignment
indicated on the drawings shall be maintained by deflecting joints and
by adding fittings if necessary. The length between structures and PI
locations shall be adjusted in the field if required.]

2Specifier. Include the following paragraph when rubber and steel
joints are specified.

3[Shop fabricated closure pieces shall be furnished for pipe with
rubber and steel joints. The closure pieces may be cut in the field in
accordance with the manufacturer's recommendations. Following
installation, each closure piece shall be encased in at least 6 inches
[150 mm] of mesh reinforced concrete. All exposed metal surfaces
inside each closure piece shall be protected with joint mortar.]}
 
J

Jean-Guy Marcil

frogman was telling us:
frogman nous racontait que :
WindowsXP pro
Word 2002

here is the problem:
numbers indicate what paragraph i am talking about

[ start of a choise
] end of a choise

1 and 3 are choises you can have either paragraph 1 or 3 but not both.

2 is a specifier table that is hidden with the paragraph symbol below
it when the final macro is run.

when 1 is hidden and the final macro is run 3 does not wrap back to
where paragraph 1 is.

Where does it wrap to?

Can you post the macro you are writing about?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
F

frogman

this is the macro and function that hides the text.

if you take the paragraphs above and paste them into Word and format in
this way:
all the {}[] should be red and bold but not [150 mm]
Specifier... should be in a single row table with border on and the
text should be italics and blue
Closure Pieces Rubber and Concrete Joints. should be underlined

if emailing you the file would help just let me have your email address

Sub Final()
Application.ScreenUpdating = False
Dim i As Integer
'Find tables with blue italics text
Application.ActiveWindow.ActivePane.View.ShowAll = True
Selection.HomeKey unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.Font.Italic = True
.Font.Color = wdColorBlue
.Font.Hidden = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute

'Loop through and find all tables and hide the tables
While Selection.Find.Found
Selection.SelectRow
Selection.Font.Hidden = True
If Selection.Font.Color = wdColorBlue And
Selection.Font.Italic = True Then
Selection.Borders.Enable = False
End If
'if the selection is the last row of a table then hide the
return after it.
If Selection.Rows.Last.IsLast Then
Selection.Move unit:=wdParagraph, Count:=1
Selection.Paragraphs(1).Range.Select
Selection.Font.Hidden = True
End If
Selection.HomeKey unit:=wdStory
Selection.Find.Execute
Wend

'Find all the nonbold red "["
Call FindBold("[", False, False)
'Find all the nonbold red "]"
Call FindBold("]", False, False)
'Find all the bold red "{"
Call FindBold("{", False, True)
'Find all the bold red "}"
Call FindBold("}", False, True)
'Find all the bold red "["
Call FindBold("[", False, True)
'Find all the bold red "]"
Call FindBold("]", False, True)

ActiveWindow.View.FieldShading = wdFieldShadingNever
Application.ActiveWindow.ActivePane.View.ShowAll = False
Application.ActiveWindow.View.ShowHiddenText = False
Application.ScreenUpdating = True
End Sub


Function FindBold(strChar, blnHidden, blnBold)
Selection.HomeKey unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = strChar
.Forward = True
.Wrap = wdFindContinue
.Format = True
.Font.Bold = blnBold
.Font.Color = wdColorRed
.Font.Hidden = blnHidden
.Replacement.Font.Hidden = Not blnHidden
End With

'Execute the find command
Selection.Find.Execute Replace:=wdReplaceAll, Format:=True
End Function
 

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