Similar Threads:
1.insert text in arrow lines problem
I want to draw 2 rectangles with arrow in between, and add text on the arrow
lines. I was able to create 2 rectangles and arrow, but I couldn't add text
on the arrow lines. When I click arrow line, it will pop up a dialog window
"Format AutoShape," but the text box tab is disabled. Any ideas to the
workaround?? Thanks!!
2.Problem inserting picture on a line of text at top of page inWord
In Word 2007 when I have Spacing Before set (eg to 18), I type half a line of
text, then insert a small picture onto the line, then carry on typing the
rest of the line.
If this is at the top of the document - no problem.
If I do this at the top of any other page, the picture does not align
correctly. The picture appears slightly lower on the line, and also the
bottom of the picture gets cropped by the text on the following line.
There is no problem if an Enter character precedes the line (that has the
picture on it).
The problem only occurs at the top of a new page, but the problem does not
occur on the FIRST page of the document.
The problem does not occur if Spacing Before is NOT set for the paragraph.
The fault is easily re-produced by doing the following:
(Open an existing Word 2007 document; ensure Spacing Before is set, eg to
18, for the paragraphs; put the cursor half-way along the fist line on the
first page of the document, and Insert | Picture | select a small jpg file
(or resize the picture so it is only a few centimetres wide). No problem.
Now, go to the top of the 2nd page, and insert a picture the same as above
(half-way along the first line of text).
Note how the picture gets cropped at the bottom. It gets cropped, because
the picture placement is lower on the line, and extends onto the 2nd line.
Is this poor alignment a bug?
If you press the Enter key at the start of the first line on this page, the
picture aligns itself correctly.
Hmmmmmmmm.
Thanks for taking the time to read my posting.
3.Deleting bad line breaks and arrows from copied e-mail text
Mr. B,
Here's my all-purpose macro that I use for this job. It removes the bad
line breaks as well as removing any arrows and adjusting the remaining
spaces around them, plus a bunch of other functions which I can't
explain right now. Just install this macro and the accompanying
function in your VB editor (write back if you need instructions on
installing a macro), assign a keystroke or menu button to the macro, and
it will do it all for you in one step.
A couple of the comments may be confusing, but I've had this macro
around for a long time now, with various modifications to it being added
from time to time, and I haven't had to time to make it look perfectly
clean. However, it's in good working shape.
Larry
Sub ArrowsAndLineBreaksDelete()
' by Larry
Application.ScreenUpdating = False
' Look for .\!\? or .\!\?" followed by line break and replace by same
followed by
' two line breaks. For e-mails with no double line breaks between
paras.
' Without adding extra line break, deleting the single linebreak makes
' whole document one paragraph.
Dim r As Range, r1 As Range
Set r = Selection.Range
Call DoArrowBreak("> ", "")
Call DoArrowBreak(">", "")
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[.:\?\!""]^l^l[A-Za-z]"
.Replacement.Text = "^~-"
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute
If .Found = False Then GoTo AddBreaks
End With
' Searches long lines with no punctuation followed by two or more
' line breaks. If no such lines exist, the text does not need to have
' multiple line breaks reduced to single line break. Thus, if there is
at least
' one proper para break, and if there is no long line broken in the
middle of a sentence (this If...Then statement),
' then only the main code runs.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l[!^l\.\?\!""-:]{54,}^l{2,}"
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute
If .Found = False Then GoTo Maincode
End With
' changing multiple line breaks to one to
' handle text with all lines separated by two line breaks
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l{2,}"
.Replacement.Text = "^l"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
AddBreaks:
' Now begins work of adding 2nd line break to true paras.
' looks for sentence end followed by line break
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([.\!\?])^l"
.Replacement.Text = "\1^l^l"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
' looks for sentence end followed by any size space followed by line
break
With Selection.Find
.Text = "([.\!\?]) {1,}^l"
.Replacement.Text = "\1^l^l"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
' looks for line break immediately following sentence end followed by
quote
With Selection.Find
.Text = "([.\!\?])("")^l"
.Replacement.Text = "\1\2^l^l"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
' looks for sentence end with quote followed by any size space followed
by line break
With Selection.Find
.Text = "([.\!\?])("") {1,}^l"
.Replacement.Text = "\1\2^l^l"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
' jump over add2nd linebreak
Maincode:
Call DoArrowBreak("^l^l", "^p^p")
Call DoArrowBreak("^l", " ")
' clean out empty space or spaces at beginning of some lines
With Selection.Find
.Text = "^13 {1,}"
.Replacement.Text = "^p"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Reduces two or more interword spaces to one throughout document
Set r1 = Selection.Range
Selection.HomeKey wdStory
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "([a-z\A-Z\0-9\,\;])( {2,})([a-z\A-Z\0-9\""\'])"
.Replacement.Text = "\1 \3"
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
' This looks for quotes not following sentence punctuation
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "([!.\?\!][""\'])( {2,})([a-z\A-Z\0-9\""\'])"
.Replacement.Text = "\1 \3"
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
r1.Select
' change single hyphens surrounded by space to double nonbreaking
hyphens
Call DoArrowBreak(" - ", "^~-")
' Reduce three or more para marks to two.
With Selection.Find
.Text = "^13{3,}"
.Replacement.Text = "^p^p"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
'clear find
With Selection.Find
.Text = ""
.Replacement.Text = ""
.MatchWildcards = False
End With
r.Select
' Dismiss selection if there is one
If Selection.Type = wdSelectionNormal Then Selection.Collapse
wdCollapseStart
End sub
Function DoArrowBreak(findText As String, ReplaceText As String)
' Works with ArrowsAndLineBreaksDelete macro
Selection.Find.MatchWildcards = False
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = findText
.Replacement.Text = ReplaceText
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Function
'-----------------
Mr B wrote:
> I always get documents that were created in a newsgroup or email
> program or something where the lines of text go only halfway across
> the page and then there's a hard line return at the end of Every
> line. I'm looking for the easiest way to get rid of the line returns
> and make it span the normal width of the page with standard word
> wrapping.
>
> I thought I could do a Find & Replace and anywhere I Fidn a Line
> Return, just replace it with a Space but I can't seem to find a way
> to do that.
>
> Any other suggestions?
>
> Thanks.
4.Inserting lines in word that text can go over w/out moving lines
How can I insert lines in a microsoft word document where you can type over
the lines without the lines moving or changing - example trying to create an
application that people can complete directly on their computer.
5.how to insert text in an existing line w/o adjusting line length
I am attempting to insert text on an existing form (line) in word. In so
doing, the line adjusts - I would like to retain the existing settings for
the lines and only insert the text on top of the line.
Thanks for any help.
6. Text Position when inserting in line with text
7. Can't Use Arrows to Navigate Text in Text Box
8. Microsoft Word XP Rotating Text in a Text Box to Align with Diagonal Arrow