引用microsoft word object library 后还是用户定义类型未定义 10
DimMyWordAsObjectDimNewDocAsObjectDimNewObjAsWorksheetDimastrAsStringPrivateSubComman...
Dim MyWord As Object
Dim NewDoc As Object
Dim NewObj As Worksheet
Dim astr As String
Private Sub Command1_Click()
Set MyWord = CreateObject("Word.Application")
MyWord.Visible = True
MyWord.Caption = "This word sample"
Set NewDoc = Nothing
End Sub
Private Sub Command2_Click()
Set NewDoc = MyWord.Documents.Add
NewDoc.Paragraphs(1).Range.Text = "Ok,This is my first samples"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MyWord.Quit
End Sub
VB 总显示Dim NewObj As Worksheet 用户类型未定义
我按照网上说的在工程——引用——Microsoftword 14.0 Object Library 可是还是不行。求教大神。 展开
Dim NewDoc As Object
Dim NewObj As Worksheet
Dim astr As String
Private Sub Command1_Click()
Set MyWord = CreateObject("Word.Application")
MyWord.Visible = True
MyWord.Caption = "This word sample"
Set NewDoc = Nothing
End Sub
Private Sub Command2_Click()
Set NewDoc = MyWord.Documents.Add
NewDoc.Paragraphs(1).Range.Text = "Ok,This is my first samples"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MyWord.Quit
End Sub
VB 总显示Dim NewObj As Worksheet 用户类型未定义
我按照网上说的在工程——引用——Microsoftword 14.0 Object Library 可是还是不行。求教大神。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询