Sub 自動編號()
Application.ScreenUpdating = False
Dim shpTemp As Shape, intStart As Long
intStart = InputBox("請輸入編號的起始數,默認為“1000000001”:", "輸入數值", "1000000001")
For Each shpTemp In ThisDocument.Shapes
shpTemp.TextFrame.TextRange.Paragraphs(2).Range = "存根:NO " & intStart
intStart = intStart + 1
Next
Application.ScreenUpdating = True
End Sub
uj5u.com熱心網友回復:
改了一下,增加字體顏色和大小,你可以手動修改字體大小(Font.Size):
Option Explicit
Sub 自動編號()
Application.ScreenUpdating = False
Dim shpTemp As Shape, intStart As Long
intStart = InputBox("請輸入編號的起始數,默認為“1000000001”:", "輸入數值", "1000000001")
For Each shpTemp In ThisDocument.Shapes
With shpTemp.TextFrame.TextRange.Paragraphs(2).Range
.Text = "存根:NO " & intStart
.Bold = True
.Font.Color = wdColorRed
.Font.Size = 15
End With
intStart = intStart + 1
Next
Application.ScreenUpdating = True
End Sub