请参考:
Sub Macro1() Dim MyValue On Error Resume Next Randomize ' 对随机数生成器做初始化的动作。
MyValue = 6 * Rnd ' 生成 1 到 6 之间的随机数值。 'MsgBox MyValue Select Case MyValue Case Is <= 1 ActiveDocument.AttachedTemplate.AutoTextEntries("签名1").Insert Where:= _ Selection.Range, RichText:=True Case Is <= 2 ActiveDocument.AttachedTemplate.AutoTextEntries("签名2").Insert Where:= _ Selection.Range, RichText:=True Case Is <= 3 ActiveDocument.AttachedTemplate.AutoTextEntries("签名3").Insert Where:= _ Selection.Range, RichText:=True Case Is <= 4 ActiveDocument.AttachedTemplate.AutoTextEntries("签名4").Insert Where:= _ Selection.Range, RichText:=True Case Is <= 5 ActiveDocument.AttachedTemplate.AutoTextEntries("签名5").Insert Where:= _ Selection.Range, RichText:=True Case Is <= 6 ActiveDocument.AttachedTemplate.AutoTextEntries("签名6").Insert Where:= _ Selection.Range, RichText:=True End Select End Sub
请楼主注意,需设置六个(自定义)图章(或签名)的自动图文集。
[此贴子已经被作者于2004-3-18 10:46:56编辑过] |