#2
xyxcc1772017-11-25 10:39
|
im myword As Word.Application
Dim myd As Word.Document
Dim myr As Word.Range
Dim myr1 As Word.Range
Dim mys As Word.Selection
Dim myt As Word.Table
myword.Selection.EndKey unit:=wdStory '***************表格光标定位
Call myword.ActiveDocument.Tables.Add(myword.Application.Selection.Range, 16, 1, 1, 0) '***************建立表格
myword.ActiveDocument.Tables(1).Cell(1, 1).Range.InsertAfter "1" '访问表格
myword.ActiveDocument.Tables(1).Cell(2, 1).Range.InsertAfter "2"
myword.ActiveDocument.Tables(1).Cell(3, 1).Range.InsertAfter "3"
myword.ActiveDocument.Tables(1).Cell(4, 1).Range.InsertAfter "4"
myword.ActiveDocument.Tables(1).Cell(5, 1).Range.InsertAfter "5"
myword.ActiveDocument.Tables(1).Cell(6, 1).Range.InsertAfter "6"
myword.ActiveDocument.Tables(1).Cell(7, 1).Range.InsertAfter "7"
myword.ActiveDocument.Tables(1).Cell(8, 1).Range.InsertAfter "8"
myword.ActiveDocument.Tables(1).Cell(9, 1).Range.InsertAfter "9"
myword.ActiveDocument.Tables(1).Cell(10, 1).Range.InsertAfter "10 "
myword.ActiveDocument.Tables(1).Cell(11, 1).Range.InsertAfter "11"
myword.ActiveDocument.Tables(1).Cell(12, 1).Range.InsertAfter "12"
myword.ActiveDocument.Tables(1).Cell(13, 1).Range.InsertAfter "13"
myword.ActiveDocument.Tables(1).Cell(14, 1).Range.InsertAfter "14"
myword.ActiveDocument.Tables(1).Cell(15, 1).Range.InsertAfter "15"
myword.ActiveDocument.Tables(1).Cell(16, 1).Range.InsertAfter "16"
myword.ActiveDocument.Tables(1).Cell(1, 1).Range.Paragraphs.Alignment = wdAlignParagraphCenter '定位表格居中
'*****表格字号
myword.ActiveDocument.Tables(1).Cell(1, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(2, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(3, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(4, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(5, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(6, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(7, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(8, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(9, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(10, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(11, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(12, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(13, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(14, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(15, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(16, 1).Range.Font.Size = 8
myword.ActiveDocument.Tables(1).Cell(12, 1).Range.Font.Color = vbRed '***颜色
myword.ActiveDocument.Tables(1).Cell(13, 1).Range.Font.Color = vbRed
myword.ActiveDocument.Tables(1).Cell(12, 1).Range.Font.Bold = True
myword.ActiveDocument.Tables(1).Cell(13, 1).Range.Font.Bold = True
myword.Selection.EndKey unit:=wdStory
myword.Selection.TypeParagraph
myr.Paragraphs.Alignment = wdAlignParagraphCenter
myr.InsertAfter "aaaa" & Chr(13)
myr.Font.Name = "宋体"
myr.Font.Size = 9
myr.Font.Underline = False
myr.Font.Bold = False
myr.Start = myr.End