为了在EXCEL中调用WORD文件,我参考有关资料编了一个程序如下,但运行时只能到WORD界面,而对其格式的更改命令却无法应用,说是不支持该属性可方法.哪位大侠能帮我?
Sub AA()
Dim wd1 As Word.Application
Set wd1 = New Word.Application
With wd1
.Documents.Open Filename:="c:\AA.doc"
.Selection.TypeParagraph
.Selection.TypeText Text:="试用WORD!"
Selection.WholeStory
With Selection.Font
.NameFarEast = "宋体"
.NameAscii = "Times New Roman"
.NameOther = "Times New Roman"
.Size = 180
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.Strikethrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 33
.Position = 0
.Kerning = 1
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
End With
End With
End Sub |