OFFICE 宏

来源:百度知道 编辑:UC知道 时间:2024/05/22 16:37:28
宏在 2007-9-4 由 hanshu 录制 ' foe
for i=stre(1) 1to20
Selection.TypeText Text:= i+1 "."
Selection.TypeParagraph
Selection.TypeText Text:="a"
Selection.TypeParagraph
Selection.TypeText Text:="b"
Selection.TypeParagraph
Selection.TypeText Text:="c"
Selection.TypeParagraph
Selection.TypeText Text:="d"
Selection.TypeParagraph

Next

这个代码 是错误的 我想 打出 从

1.
a
b
c
d
2.
a
b
c
d
3.
a
b
c
d
的形式

麻烦 告诉一下啊
因为分是负数了 所以 没有 悬赏 对不住了啊

你看下面的代码实现了你要的功能没?

Sub test()

Dim i As Long

For i = 1 To 20

Selection.TypeText Text:=i & "."
Selection.TypeParagraph
Selection.TypeText Text:="a"
Selection.TypeParagraph
Selection.TypeText Text:="b"
Selection.TypeParagraph
Selection.TypeText Text:="c"
Selection.TypeParagraph
Selection.TypeText Text:="d"
Selection.TypeParagraph

Next i

End Sub

====================
运行结果:
1.
a
b
c
d
2.
a
b
c
d
3.
a
b
c
d
4.
a
b
c
d
5.
a
b
c
d
6.
a
b
c
d
7.
a
b
c
d
8.
a
b
c
d
9.
a
b
c
d
10.
a
b