|
- Sub AutoOpen()
- Dim s$, t$
- With ActiveDocument
- If .Paragraphs(1).Range Like "20??年*月*日*" Then
- .Paragraphs(1).Range.Delete
-
- s = Weekday(Date)
- If s = 1 Then s = 8
- s = s - 1
-
- If s = 1 Then
- t = "星期日"
- ElseIf s = 2 Then
- t = "星期一"
- ElseIf s = 3 Then
- t = "星期二"
- ElseIf s = 4 Then
- t = "星期三"
- ElseIf s = 5 Then
- t = "星期四"
- ElseIf s = 6 Then
- t = "星期五"
- ElseIf s = 7 Then
- t = "星期六"
- End If
-
- With Selection
- .HomeKey 6
- .TypeText Text:=DateAdd("d", -1, Date)
- .TypeParagraph
- End With
-
- .Characters(5).Text = "年"
- If .Characters(7).Text = "-" Then .Characters(7).Text = "月"
- If .Characters(8).Text = "-" Then .Characters(8).Text = "月"
- .Paragraphs(1).Range.Characters.Last.InsertBefore Text:="日(" & t & " 晴~多云)"
- End If
-
- With .Paragraphs(1).Range.Font
- .Color = wdColorRed
- .Italic = False
- End With
- End With
- End Sub
复制代码 |
|