I haven't figured a good way to deliver this macro other than to suggest creating a blank macro and cut and paste the following code into it. There are so many virii masquerading as macros that this is probably the best way.
This code is rude and crude. I have not made any attempt to optimize it. It performs successfully on the reports created at my installation. I make no claims that it will work at yours.
The first thing this macro does is format the complete document. The document is setup to be landscaped, with minimum margins. The font is setup to be Courier New, 8pt.
| Dim A$ WordBasic.EditSelectAll WordBasic.Font "Courier New" WordBasic.FontSize 8 WordBasic.FilePageSetup Tab:="0", PaperSize:="1", TopMargin:="0.25" + Chr(34), BottomMargin:=".25" + Chr(34), LeftMargin:="0.25" + Chr(34), RightMargin:=".25" + Chr(34), Gutter:="0" + Chr(34), PageWidth:="11" + Chr(34), PageHeight:="8.5" + Chr(34), Orientation:=1, FirstPage:=0, OtherPages:=0, VertAlign:=0, ApplyPropsTo:=3, FacingPages:=0, HeaderDistance:="0.5" + Chr(34), FooterDistance:="0.5" + Chr(34), SectionStart:=2, OddAndEvenPages:=0, DifferentFirstPage:=0, Endnotes:=0, LineNum:=0, StartingNum:="", FromText:="", CountBy:="0", NumMode:=-1 WordBasic.Overtype 1 WordBasic.StartOfDocument WordBasic.EditClear 1 WordBasic.EndOfLine WordBasic.CharRight While WordBasic.CmpBookmarks("\Sel", "\EndOfDoc") A$ = WordBasic.[GetBookmark$]("\Char") If A$ = "1" Then WordBasic.WW7_InsertPageBreak WordBasic.EditClear WordBasic.Insert " " ElseIf A$ = "0" Then WordBasic.InsertBreak Type:=6 WordBasic.EditClear WordBasic.Insert " " ElseIf A$ = "-" Then WordBasic.InsertBreak Type:=6 WordBasic.InsertBreak Type:=6 WordBasic.EditClear WordBasic.Insert " " End If ' EditClear ' Insert " " WordBasic.EndOfLine WordBasic.CharRight Wend WordBasic.MsgBox "End of document." |