|
本帖最后由 413191246se 于 2022-9-7 19:46 编辑
* 最近在默诵《乘法口诀表》(小九九)时竟然把 7 x 9 误会为 83,反复思考才得知是 63!好久没背诵了。
* 正好网上说这也算是一道编程题,遂今天中午就练习编写,最后误打误撞就成功了,此宏可以锻炼记忆力。
* 如果想打印的话,请自行打几下回车,使之在纸张正中才美观好看,现在呈现效果是在屏幕上正好合适。
- Sub a0907_MultiplicationTable()
- '乘法口诀表(小九九)
- Dim i&, j&
- Documents.Add
- With Selection
- For j = 1 To 9
- For i = 1 To 9
- .TypeText Text:=i & " x " & j & " = " & i * j & Chr(-24159)
- If i = j Then .TypeParagraph: Exit For
- Next
- Next
- .HomeKey 6
- End With
- With ActiveDocument
- With .Content
- .Find.Execute "(?)(^13)", , , 1, , , , , , "\2", 2
- With .Font
- .NameAscii = "Times New Roman"
- .Size = 15
- .Bold = True
- End With
- .InsertBefore Text:="乘法口诀表" & vbCr
- End With
- With .Paragraphs(1)
- .Style = wdStyleHeading1
- .SpaceBefore = 0
- .SpaceAfter = 0
- .Range.Underline = wdUnderlineDouble
- End With
- With .PageSetup
- .Orientation = wdOrientLandscape
- .TopMargin = CentimetersToPoints(0.3)
- .BottomMargin = CentimetersToPoints(2.5)
- .LeftMargin = CentimetersToPoints(2.54)
- .RightMargin = CentimetersToPoints(2.54)
- .PageWidth = CentimetersToPoints(29.7)
- .PageHeight = CentimetersToPoints(21)
- End With
- End With
- With ActiveWindow.ActivePane.View
- .Zoom.PageFit = wdPageFitFullPage
- .Zoom.PageFit = wdPageFitBestFit
- .ShowAll = False
- End With
- Selection.MoveUp Unit:=wdScreen, Count:=1
- End Sub
复制代码 |
|