A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Publisher
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Universal widow and orphan control



 
 
Thread Tools Display Modes
  #1  
Old July 30th, 2004, 03:53 PM
Box
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

How can I make widow and orphan control apply to an entire (60 page) document without selecting each and every paragraph and then changing widow and orphan control for each separate paragraph?
  #2  
Old July 30th, 2004, 07:42 PM
Brian Kvalheim - [MSFT MVP]
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

Hi Box ),
in the newsgroups
you posted:

|| How can I make widow and orphan control apply to an entire (60 page)
|| document without selecting each and every paragraph and then
|| changing widow and orphan control for each separate paragraph?

You can only change widow/orphan control page by page (you can select
mulitple paragraphs in one text box on a page) and apply the setting. You
cannot select the entire story over the 60 pages.

You could also use the VBA Macro writing ability in Publisher and write a
code to do so.

You could also create a Text Style from the very beginning, which you can
apply Widow/Orphan control, which will then be carried out through your
entire publcation.

--
Brian Kvalheim
Microsoft Publisher MVP
http://www.publishermvps.com
~pay it forward~

This posting is provided "AS IS" with no warranties, and
confers no rights.


  #3  
Old July 30th, 2004, 07:42 PM
Brian Kvalheim - [MSFT MVP]
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

Hi Box ),
in the newsgroups
you posted:

|| How can I make widow and orphan control apply to an entire (60 page)
|| document without selecting each and every paragraph and then
|| changing widow and orphan control for each separate paragraph?

You can only change widow/orphan control page by page (you can select
mulitple paragraphs in one text box on a page) and apply the setting. You
cannot select the entire story over the 60 pages.

You could also use the VBA Macro writing ability in Publisher and write a
code to do so.

You could also create a Text Style from the very beginning, which you can
apply Widow/Orphan control, which will then be carried out through your
entire publcation.

--
Brian Kvalheim
Microsoft Publisher MVP
http://www.publishermvps.com
~pay it forward~

This posting is provided "AS IS" with no warranties, and
confers no rights.


  #4  
Old July 30th, 2004, 07:42 PM
Brian Kvalheim - [MSFT MVP]
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

Hi Box ),
in the newsgroups
you posted:

|| How can I make widow and orphan control apply to an entire (60 page)
|| document without selecting each and every paragraph and then
|| changing widow and orphan control for each separate paragraph?

You can only change widow/orphan control page by page (you can select
mulitple paragraphs in one text box on a page) and apply the setting. You
cannot select the entire story over the 60 pages.

You could also use the VBA Macro writing ability in Publisher and write a
code to do so.

You could also create a Text Style from the very beginning, which you can
apply Widow/Orphan control, which will then be carried out through your
entire publcation.

--
Brian Kvalheim
Microsoft Publisher MVP
http://www.publishermvps.com
~pay it forward~

This posting is provided "AS IS" with no warranties, and
confers no rights.


  #5  
Old July 30th, 2004, 08:07 PM
Ed Bennett
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

A small child turns to Ed, and exclaims: "Look! Look! A post from Brian
Kvalheim - [MSFT MVP] !"...
You could also use the VBA Macro writing ability in Publisher and
write a code to do so.


Close all running instances of Publisher.
Open one instance of Publisher.
Open your document.
Go to Tools Macros Visual Basic Editor
In the left pane, click all the [+]s that you can see, until you see
ThisDocument.
Double-click ThisDocument.
Into the window that appears, paste the following code

====
Sub Jim()
Dim aPage As Page
Dim aShape As Shape
Dim aparagraph
Dim Bob
Bob = MsgBox("Click Yes to turn widow control ON globally throughout the
current document." & vbCrLf & "Click No to turn widow control OFF globally
throughout the current document." & vbCr & "Click Cancel to cancel and not
change widow/orphan control globally.", vbYesNoCancel)
If Bob = vbCancel Then Exit Sub
For Each aPage In ThisDocument.Pages
For Each aShape In aPage
If aShape.Type = pbTextFrame Then
aShape.TextFrame.TextRange.Select
If Bob = vbYes Then
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
= msoTrue
Else
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
= msoFalse
End If
End If
Next
Next
End Sub
====

(excluding the ==== at either side)
Now, in the "Immediate" window below the area where you pasted my code, type
"Jim" (without the quotes), and press Return.
Answer the question that appears on your screen.

Any problems, post them here and I'll try to fix them.

Less hacky solution arriving in a few hours maybe.

--
Ed Bennett - MVP Microsoft Publisher
http://www.mvps.org/the_nerd/
Before reading this message, view the disclaimer:
http://mvps.org/the_nerd/disclaim.htm


  #6  
Old July 30th, 2004, 08:07 PM
Ed Bennett
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

A small child turns to Ed, and exclaims: "Look! Look! A post from Brian
Kvalheim - [MSFT MVP] !"...
You could also use the VBA Macro writing ability in Publisher and
write a code to do so.


Close all running instances of Publisher.
Open one instance of Publisher.
Open your document.
Go to Tools Macros Visual Basic Editor
In the left pane, click all the [+]s that you can see, until you see
ThisDocument.
Double-click ThisDocument.
Into the window that appears, paste the following code

====
Sub Jim()
Dim aPage As Page
Dim aShape As Shape
Dim aparagraph
Dim Bob
Bob = MsgBox("Click Yes to turn widow control ON globally throughout the
current document." & vbCrLf & "Click No to turn widow control OFF globally
throughout the current document." & vbCr & "Click Cancel to cancel and not
change widow/orphan control globally.", vbYesNoCancel)
If Bob = vbCancel Then Exit Sub
For Each aPage In ThisDocument.Pages
For Each aShape In aPage
If aShape.Type = pbTextFrame Then
aShape.TextFrame.TextRange.Select
If Bob = vbYes Then
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
= msoTrue
Else
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
= msoFalse
End If
End If
Next
Next
End Sub
====

(excluding the ==== at either side)
Now, in the "Immediate" window below the area where you pasted my code, type
"Jim" (without the quotes), and press Return.
Answer the question that appears on your screen.

Any problems, post them here and I'll try to fix them.

Less hacky solution arriving in a few hours maybe.

--
Ed Bennett - MVP Microsoft Publisher
http://www.mvps.org/the_nerd/
Before reading this message, view the disclaimer:
http://mvps.org/the_nerd/disclaim.htm


  #7  
Old July 30th, 2004, 08:07 PM
Ed Bennett
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

A small child turns to Ed, and exclaims: "Look! Look! A post from Brian
Kvalheim - [MSFT MVP] !"...
You could also use the VBA Macro writing ability in Publisher and
write a code to do so.


Close all running instances of Publisher.
Open one instance of Publisher.
Open your document.
Go to Tools Macros Visual Basic Editor
In the left pane, click all the [+]s that you can see, until you see
ThisDocument.
Double-click ThisDocument.
Into the window that appears, paste the following code

====
Sub Jim()
Dim aPage As Page
Dim aShape As Shape
Dim aparagraph
Dim Bob
Bob = MsgBox("Click Yes to turn widow control ON globally throughout the
current document." & vbCrLf & "Click No to turn widow control OFF globally
throughout the current document." & vbCr & "Click Cancel to cancel and not
change widow/orphan control globally.", vbYesNoCancel)
If Bob = vbCancel Then Exit Sub
For Each aPage In ThisDocument.Pages
For Each aShape In aPage
If aShape.Type = pbTextFrame Then
aShape.TextFrame.TextRange.Select
If Bob = vbYes Then
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
= msoTrue
Else
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
= msoFalse
End If
End If
Next
Next
End Sub
====

(excluding the ==== at either side)
Now, in the "Immediate" window below the area where you pasted my code, type
"Jim" (without the quotes), and press Return.
Answer the question that appears on your screen.

Any problems, post them here and I'll try to fix them.

Less hacky solution arriving in a few hours maybe.

--
Ed Bennett - MVP Microsoft Publisher
http://www.mvps.org/the_nerd/
Before reading this message, view the disclaimer:
http://mvps.org/the_nerd/disclaim.htm


  #8  
Old July 30th, 2004, 08:13 PM
Brian Kvalheim - [MSFT MVP]
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

Hi Ed Bennett ),
in the newsgroups
you posted:

|| A small child turns to Ed, and exclaims: "Look! Look! A post from
|| Brian Kvalheim - [MSFT MVP] !"...
||| You could also use the VBA Macro writing ability in Publisher and
||| write a code to do so.
||
|| Close all running instances of Publisher.
|| Open one instance of Publisher.
|| Open your document.
|| Go to Tools Macros Visual Basic Editor
|| In the left pane, click all the [+]s that you can see, until you see
|| ThisDocument.
|| Double-click ThisDocument.
|| Into the window that appears, paste the following code
||
|| ====
|| Sub Jim()
|| Dim aPage As Page
|| Dim aShape As Shape
|| Dim aparagraph
|| Dim Bob
|| Bob = MsgBox("Click Yes to turn widow control ON globally
|| throughout the current document." & vbCrLf & "Click No to turn widow
|| control OFF globally throughout the current document." & vbCr &
|| "Click Cancel to cancel and not change widow/orphan control
|| globally.", vbYesNoCancel) If Bob = vbCancel Then Exit Sub
|| For Each aPage In ThisDocument.Pages
|| For Each aShape In aPage
|| If aShape.Type = pbTextFrame Then
|| aShape.TextFrame.TextRange.Select
|| If Bob = vbYes Then
||
|| aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol = msoTrue
|| Else
||
|| aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol = msoFalse
|| End If
|| End If
|| Next
|| Next
|| End Sub
|| ====
||
|| (excluding the ==== at either side)
|| Now, in the "Immediate" window below the area where you pasted my
|| code, type "Jim" (without the quotes), and press Return.
|| Answer the question that appears on your screen.
||
|| Any problems, post them here and I'll try to fix them.
||
|| Less hacky solution arriving in a few hours maybe.

Ed, I love you man! lol
--
Brian Kvalheim
Microsoft Publisher MVP
http://www.publishermvps.com
~pay it forward~

This posting is provided "AS IS" with no warranties, and
confers no rights.


  #9  
Old July 30th, 2004, 09:22 PM
Ed Bennett
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

A small child turns to Ed, and exclaims: "Look! Look! A post from Ed
Bennett !"...
Into the window that appears, paste the following code


Replace that code with...

====
Sub Jim()
Dim aPage As Page
Dim aShape As Shape
Dim aparagraph
Dim Bob
Bob = MsgBox("Click Yes to turn widow control ON globally throughout the
current document." & vbCrLf & "Click No to turn widow control OFF globally
throughout the current document." & vbCr & "Click Cancel to cancel and not
change widow/orphan control globally.", vbYesNoCancel)
If Bob = vbCancel Then Exit Sub
For Each aPage In ThisDocument.Pages
For Each aShape In aPage.Shapes
If aShape.Type = pbTextFrame Then
aShape.TextFrame.TextRange.Select
If Bob = vbYes Then
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
_
= msoTrue
Else
aShape.TextFrame.TextRange.ParagraphFormat.WidowCo ntrol
_
= msoFalse
End If
End If
Next
Next
End Sub
====

--
Ed Bennett - MVP Microsoft Publisher
http://www.mvps.org/the_nerd/
Before reading this message, view the disclaimer:
http://mvps.org/the_nerd/disclaim.htm


  #10  
Old July 30th, 2004, 10:43 PM
Ed Bennett
external usenet poster
 
Posts: n/a
Default Universal widow and orphan control

A small child turns to Ed, and exclaims: "Look! Look! A post from Ed
Bennett !"...
Close all running instances of Publisher.
Open one instance of Publisher.


Or if you don't want to get coding with it, you can go here to download an
add-in:
http://www.publishermvps.com/Default.aspx?tabid=43

--
Ed Bennett - MVP Microsoft Publisher
http://www.mvps.org/the_nerd/
Before reading this message, view the disclaimer:
http://mvps.org/the_nerd/disclaim.htm


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.