Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Selection in Word 97

Status
Not open for further replies.

unbehaun

Technical User
May 29, 2002
2
US
Why (when I highlight a selection in Word 97) doesn't it print the selection at the same vertical position? Instead, it prints at the top of the page. Rather than print out my entire page of case notes, I like to add to them, thus saving paper.

I can do this in WordPerfect; why not in Word?
 
Do you mean that you would like to print a section and then add to it later? If so, I know this seems like a lot but you may want to try to change the top margin before you print the next section or you can cut and paste to new word doc and continue to add as needed.

I hope this help:)

Michele P
 
Yes, I want to add to my case notes, then print the additions on the existing case note page, thus saving paper. I'm reading from your answer that I could change the top margin to reflect the verticle position, then print. It does seem like a lot of work. I was hoping that there was a setting or workaround to make Word behave like WordPerfect. I'm still open to suggestions. Thanks!
 
Hi unbehaun

Really kludgy attempt at doing what you want: essentially, you set the font of everything in the document except your selection to white, thus:

Sub printSel()
dim s as Range

set s=ActiveDocument.Range(Start:=0, End:=Selection.Start - 1)
s.Font.ColorIndex = wdWhite

Set s = ActiveDocument.Range(Start:=Selection.End, End:=ActiveDocument.Content.End)
s.Font.ColorIndex = wdWhite

ActiveDocument.PrintOut

End Sub


I haven't bothered setting everything back again, although that's easy enough. I also found that the number of the first paragraph (if it has one) will still print; as will headers, footers, etc, although these could be fixed with different storytypes... Oh, and as shown above, this doesn't even check that there is a selection, so it falls over ungraciously on an empty document... Oh, and if you have one para selected out of a 30 page document, it will print 30 blank pages... but hopefully the idea is useful... unless anyone can come up with a better one.

(The more I've looked at this idea, the less I think of it... sorry)

Regards

 
All right, this one's been bugging me: so I went back to Michele P's solution. The following works (with one problem):

Sub printSel()
Dim i As Integer
Dim iRetain As Integer

With ActiveDocument
iRetain = .PageSetup.TopMargin
i = (Selection.Information(wdVerticalPositionRelativeToPage) / 20) + iRetain

.PageSetup.TopMargin = i + iRetain
.PrintOut Range:=wdPrintSelection
.PageSetup.TopMargin = iRetain
End With
End Sub


The problem is that the selection.information(wdvert...) returns the position of the top of the selection, not the top of the text in the selection; so if you've got Space Before your selected paragraph, it will position the top margin at the point where the white space begins. But I guess that's overcomable somehow.

HTH

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top