J
Julian
ÏÈ¿´ÔÚwordÖеÄÒ»¸öºê£º
Sub Macro1()
'н¨Ò»¸ö¿Õ°×Îĵµ£¬ÀïÃæĬÈÏÓÐParagraphs(1)
ActiveDocument.Paragraphs(1).Range.Text = "Date:"
ActiveDocument.Paragraphs(1).Range.Select
Selection.MoveRight
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldDate
End Sub
ÒÔÉÏ´úÂëÓÃÓò²åÈëÁËÈÕÆÚ£¬Ã»ÓÐÎÊÌâ
ÔÙ¿´ÔÚExcelÖеÄʵÏÖͬÑù¹¦Äܵĺ꣺
Private Sub CommandButton1_Click()
Dim oWord As Object
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Documents.Add
Set CurrentDoc = oWord.Documents(1)
CurrentDoc.Paragraphs(1).Range.Text = "Date:"
CurrentDoc.Paragraphs(1).Range.Select
oWord.Selection.MoveRight
oWord.Selection.Fields.Add Range:=oWord.Selection.Range,
Type:=wdFieldDate
End Sub
Õâ¸öºêÖ´Ðе½µ¹ÊýµÚ¶þÐж¼Ã»ÎÊÌ⣬¾Í×îºóÒ»¾äÌáʾ¡°ÔËÐÐʱ´íÎó'4068',Ó¦ÓóÌÐò¶¨Òå»ò¶ÔÏó¶¨Òå´íÎ󡱡£
¼±Çó½â£¡
Sub Macro1()
'н¨Ò»¸ö¿Õ°×Îĵµ£¬ÀïÃæĬÈÏÓÐParagraphs(1)
ActiveDocument.Paragraphs(1).Range.Text = "Date:"
ActiveDocument.Paragraphs(1).Range.Select
Selection.MoveRight
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldDate
End Sub
ÒÔÉÏ´úÂëÓÃÓò²åÈëÁËÈÕÆÚ£¬Ã»ÓÐÎÊÌâ
ÔÙ¿´ÔÚExcelÖеÄʵÏÖͬÑù¹¦Äܵĺ꣺
Private Sub CommandButton1_Click()
Dim oWord As Object
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Documents.Add
Set CurrentDoc = oWord.Documents(1)
CurrentDoc.Paragraphs(1).Range.Text = "Date:"
CurrentDoc.Paragraphs(1).Range.Select
oWord.Selection.MoveRight
oWord.Selection.Fields.Add Range:=oWord.Selection.Range,
Type:=wdFieldDate
End Sub
Õâ¸öºêÖ´Ðе½µ¹ÊýµÚ¶þÐж¼Ã»ÎÊÌ⣬¾Í×îºóÒ»¾äÌáʾ¡°ÔËÐÐʱ´íÎó'4068',Ó¦ÓóÌÐò¶¨Òå»ò¶ÔÏó¶¨Òå´íÎ󡱡£
¼±Çó½â£¡