Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing with Paragraph Styles In Margin

3 views
Skip to first unread message

Pat L

unread,
Aug 11, 2004, 3:09:51 PM8/11/04
to
Hi,
I need to print book manuscripts so that the style labels
appear in the margin, much as they do in the document
window when one's view is set to 'Normal' and the 'style
area' is set to a width of, say, 1.0.

I've accomplished this already by using two less than
desirable methods: by putting the style labels in text
boxes and by converting the document to a table with
style labels in one column, paragraph text in the
adjacent column. I'm finding that using text boxes are
unpredictable on different machines and using a table is
slower than molasses.

So is anyone aware of a better way to do this? You'd
think Word (2002) would have this as a built in feature
since if it's useful to show style labels in the document
window, it stands to reason that it might be useful to
display them on hard copy. One for the wish list?

Thanks,
Pat L

Chad DeMeyer

unread,
Aug 12, 2004, 5:46:38 PM8/12/04
to
Pat,

Something like the following code might be what you're looking for. Please
not that the code as written makes at least a few assumptions. The ones
that come to mind are that 1 inch will be sufficient space for all your
style names and that your left margin is at least 1 inch wide.

Sub StyleNames()
Dim oStyle As Style
Dim oNormal As Style
Dim oSec As Section
Dim oPar As Paragraph
Dim oRng As Range

Set oStyle = ActiveDocument.Styles.Add(Name:="StyleName",
Type:=wdStyleTypeParagraph)
Set oNormal = ActiveDocument.Styles("Normal")
With oStyle
.AutomaticallyUpdate = False
.BaseStyle = "Normal"
.NextParagraphStyle = "StyleName"
.Font = oNormal.Font.Duplicate
.ParagraphFormat = oNormal.ParagraphFormat.Duplicate
.ParagraphFormat.Alignment = wdAlignParagraphRight
With .Frame
.TextWrap = True
.WidthRule = wdFrameExact
.Width = InchesToPoints(1)
.HeightRule = wdFrameAuto
.HorizontalPosition = wdFrameLeft
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.VerticalPosition = InchesToPoints(0)
.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
.HorizontalDistanceFromText = InchesToPoints(0.13)
.VerticalDistanceFromText = InchesToPoints(0)
.LockAnchor = False
End With
End With

For Each oPar In ActiveDocument.Paragraphs
Set oRng = oPar.Range
If oRng.Tables.Count = 0 Then
With oRng
.InsertBefore Text:=oPar.Style & vbCr
.Collapse Direction:=wdCollapseStart
.Style = "StyleName"
.ParagraphFormat.SpaceBefore = oPar.SpaceBefore
End With
End If
Next oPar

MsgBox Prompt:="done"
End Sub


Hope that helps
Regards,
Chad


"Pat L" <anon...@discussions.microsoft.com> wrote in message
news:46ee01c47fd6$c7501660$a601...@phx.gbl...

Klaus Linke

unread,
Aug 12, 2004, 5:53:53 PM8/12/04
to
Hi Pat,

Haven't tried... but maybe you could use a framed style in the left margin.
Each other paragraph would be in that style, and contain the name of the
style of the next paragraph.
They would be inserted by some macro.
You could hide the paragraphs in this framed style by re-defining the style
as hidden, and could delete the paragraphs with Find/Replace (... search
for the style, replace with nothing).


> One for the wish list?

Doesn't hurt to write to
http://register.microsoft.com/mswish/suggestion.asp
:-) Klaus


Pat L

unread,
Aug 13, 2004, 10:26:42 AM8/13/04
to
Chad,

Thanks for your help. Your suggestion is similar to my
current solution using text boxes, but I will test yours
to see what improvements it offers.

Thanks again.
Pat

>.
>

Pat L

unread,
Aug 13, 2004, 10:27:27 AM8/13/04
to
Thanks. I will post a request to the link you provided.
Pat

>.
>

0 new messages