Hi All,
This discussion group has been like a good friend for years. I really
appreciate y'all. :)
I'd like code for printing the section the cursor is currently in.
How might I change the code below to accomplish this?
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="s2",
PageType:=wdPrintAllPages _
, Collate:=True, Background:=False, PrintToFile:=False,
PrintZoomColumn:= _
0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
tia,
Gil
Gil Carter, MD, JD, FP, medical programming
http://www.TenSecondMedicalRecord.com, in use since 1990, free since 1997
http://www.KeyChainEMR.com Walk up to the medical ward computer, plug in,
do what you need, unplug and walk away.
Jay Freedman - 14 May 2006 16:04 GMT
Hi Gil,
The Selection.Information function can give you the current section
number, and you can use that to make a string to replace the "s2" in
your recorded macro. Also, you don't need all the default settings the
recorder insists on stuffing into the PrintOut statement. This will
do:
Dim PrintString As String
PrintString = "s" & _
Selection.Information(wdActiveEndSectionNumber)
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, _
Pages:=PrintString, Background:=False
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>Hi All,
>
[quoted text clipped - 22 lines]
>http://www.KeyChainEMR.com Walk up to the medical ward computer, plug in,
>do what you need, unplug and walk away.
gils usenet acct - 14 May 2006 21:38 GMT
thank you Jay, ... worked like a char, :) :)
Gil
> Hi Gil,
>
[quoted text clipped - 45 lines]
>>http://www.KeyChainEMR.com Walk up to the medical ward computer, plug in,
>>do what you need, unplug and walk away.