I am still trying to create a document that has 3 separate text boxes. The
one giving me problems is the one that needs to handle text overflow (if
any). I have the 3 text boxes on page 1. I need for an unlimited amount of
pages to be created (if needed) with these text boxes if there is overflow.
Also I need these text boxes to be stationary and not be deleted or moved
when I press delete on page 1 or page 2, etc. And for text to flow into the
new text box on a new page if there is overflow from the previous page.
Thank you in advance,
Marsha
--
Hope this helps,
Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
"MRupel" <MRu...@discussions.microsoft.com> wrote in message
news:D30A3DC9-E40E-4ACE...@microsoft.com...
I'm starting from scratch because I have not been able to get anything to
work properly.
Sub NewBlankPage()
'
' NewBlankPage Macro
'
'
Dim rng As Range
Set rng = ActiveDocument.Range
rng.Collapse wdCollapseEnd
rng.InsertBreak Type:=wdPageBreak
Selection.GoTo What:=wdGoToPage, Which:=wdGoToLast
Call CreateTextBoxes
Call LinkTextBoxes
End Sub
Sub CreateTextBoxes()
'
' CreateTextBoxes Macro
'
'
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 72#, _
36#, 486#, 18#).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.ShapeRange.Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.25
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 18#
Selection.ShapeRange.Width = 490#
Selection.ShapeRange.TextFrame.MarginLeft = 7.2
Selection.ShapeRange.TextFrame.MarginRight = 7.2
Selection.ShapeRange.TextFrame.MarginTop = 3.6
Selection.ShapeRange.TextFrame.MarginBottom = 3.6
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = InchesToPoints(0.5)
Selection.ShapeRange.LockAnchor = True
Selection.ShapeRange.WrapFormat.AllowOverlap = False
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.Type = 3
Selection.ShapeRange.ZOrder 5
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 63#, _
63#, 490#, 415#).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.ShapeRange.Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.25
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 415#
Selection.ShapeRange.Width = 490#
Selection.ShapeRange.TextFrame.MarginLeft = 7.2
Selection.ShapeRange.TextFrame.MarginRight = 7.2
Selection.ShapeRange.TextFrame.MarginTop = 3.6
Selection.ShapeRange.TextFrame.MarginBottom = 3.6
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = InchesToPoints(0.85)
Selection.ShapeRange.LockAnchor = True
Selection.ShapeRange.WrapFormat.AllowOverlap = False
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.Type = 3
Selection.ShapeRange.ZOrder 5
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 54#, _
540#, 490#, 255#).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.ShapeRange.Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.25
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 255#
Selection.ShapeRange.Width = 490#
Selection.ShapeRange.TextFrame.MarginLeft = 7.2
Selection.ShapeRange.TextFrame.MarginRight = 7.2
Selection.ShapeRange.TextFrame.MarginTop = 3.6
Selection.ShapeRange.TextFrame.MarginBottom = 3.6
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = InchesToPoints(6.7)
Selection.ShapeRange.LockAnchor = True
Selection.ShapeRange.WrapFormat.AllowOverlap = False
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.Type = 3
Selection.ShapeRange.ZOrder 5
End Sub
Sub LinkTextBoxes()
'
' LinkTextBoxes Macro
' Links "Main Content" text boxes
'
With ActiveDocument
With .Shapes(2).TextFrame
If .Overflowing = True Then
Selection.ShapeRange.TextFrame.Next = ActiveDocument.Shapes(2).TextFrame
End If
End With
End With
End Sub
Hope this helps....
p#tb#
so that on page one
you have
p1tb1 - the first textbox
p1tb2 - the second textbox
and
p1tb3 - the third text box
Are there any linkages between any of them?
Then you want to add a page that will have
p2tb1 - the first textbox
p2tb2 - the second textbox
and
p2tb3 - the third text box
Now, what textboxes to to be linked to what using terminology such as
p1tb3>p2tb3
to indicate that the third text box on the first page is to overflow to the
third text box on the second page and so on.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"MRupel" <MRu...@discussions.microsoft.com> wrote in message
news:3D11EE62-D53A-4918...@microsoft.com...
Does any of the following apply?
> > Sub LinkTextBoxes()
> > '
> > ' LinkTextBoxes Macro
> > ' Links "TextBox2" text boxes
All of your nomenclatures are good. I need p1tb2 to flow to p2tb2 if there
is overflow and if needed p3tb2, etc. I need to code for the linkage between
all tb2 only. All of the textboxes on page one are good (I can't delete them
or move them, which is what I want). The newly created textboxes, say on
page 2, are being deleted if I am on page one and I press delete. I need for
them to stay in place on all pages. Seems Anchor = True but....please help.
Thank you!
Dim rng As Range
Dim i As Long
Dim a As Shape, b As Shape
With ActiveDocument
Set rng = .Range
With rng
.Collapse wdCollapseEnd
.InsertFile "C:\Users\Doug\Documents\NewTextBoxDoc.doc" 'See Note
End With
i = .Range.ShapeRange.Count
Set a = .Range.ShapeRange(i - 4)
Set b = .Range.ShapeRange(i - 1)
a.TextFrame.Next = b.TextFrame
End With
Replace "C:\Users\Doug\Documents\NewTextBoxDoc.doc" with the path and
filename of the document that contains the new textboxes.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"MRupel" <MRu...@discussions.microsoft.com> wrote in message
news:3CEEF482-BD7B-4374...@microsoft.com...
--
Hope this helps,
Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
"MRupel" <MRu...@discussions.microsoft.com> wrote in message
news:14357E0F-7446-4E12...@microsoft.com...
Thank you so much!!
Here is what I have:
Dim rng As Range
Dim i As Long
Dim a As Shape, b As Shape
With ActiveDocument
Set rng = .Range
With rng
.Collapse wdCollapseEnd
rng.InsertBreak Type:=wdPageBreak
Selection.GoTo What:=wdGoToPage, Which:=wdGoToLast
.InsertFile "C:\Documents and
Settings\Me\Desktop\Salesperson_Outline\Salesperson_Outline2.dotm"
End With
i = .Range.ShapeRange.Count
Set a = .Range.ShapeRange(i - 4)
Set b = .Range.ShapeRange(i - 1)
a.TextFrame.Next = b.TextFrame
End With
End Sub
i = .Range.ShapeRange.Count
will set i = 6
The text boxes that are linked a i - 1 and i - 4
6 - 1 = 5
and
6 - 4 = 2
Therefore the second and the fifth textboxes are linked and that is exactly
what happens when I run the code.
--
Hope this helps,
Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
"MRupel" <MRu...@discussions.microsoft.com> wrote in message
news:A2889876-108B-4951...@microsoft.com...
Just one more thing (if I may)....the text boxes on the new pages are not
staying on their respective pages even though LockAnchor = True. If I am on
page one and press delete the text boxes from the other pages are being moved
and overlapping onto page one and the other pages are being deleted. Any
thoughts?
Dim rng As Range
Dim i As Long
Dim a As Shape, b As Shape
With ActiveDocument
Set rng = .Range
With rng
.Collapse wdCollapseEnd
.InsertBreak Type:=wdSectionBreakNextPage
End With
Set rng = .Range
With rng
.Collapse wdCollapseEnd
.InsertFile "C:\Users\doug.robbins\Documents\Continuation Sheet.doc"
'modify path filename as required.
End With
i = .Range.ShapeRange.Count
Set a = .Range.ShapeRange(i - 4)
Set b = .Range.ShapeRange(i - 1)
a.TextFrame.Next = b.TextFrame
End With
--
Hope this helps,
Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
"MRupel" <MRu...@discussions.microsoft.com> wrote in message
news:AA17D828-3FC1-4DC3...@microsoft.com...
I tried that new code...but it didn't seem to work. The text boxes are
still being moved to page one and subsequent pages are being deleted.
Marsha
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"MRupel" <MRu...@discussions.microsoft.com> wrote in message
news:A034779D-D4D4-40A4...@microsoft.com...