JohnL55
Jan 8th, 2000, 09:41 PM
No matter how I define strA I get type mismatch error.
'Open word document and display in MSG
'box the document propertys'
'Defined strA many different ways with
'not luck
'Run time error 122 - Type mismatch
Dim wd As Object
Dim strA As String
Dim intB As Integer
Dim strB As String
Dim intCount As Integer
Set wd = CreateObject("Word.Basic")
wd.FileOpen "a:SummaryTest.doc"
For Cnt = 1 To wd.CountDocumentProperties()
strA = wd.DocumentPropertyName$(Cnt)
If wd.DocumentPropertyType(strA) = 1 Then
strB = wd.GetDocumentProperty(strA)
Else
'Run time error 122 - Type mismatch
strB = wd.GetDocumentProperty$(strA)
MsgBox "Property " & strA & " = " & strB
End If
Next
wd.FileClose 2
Set wd = Nothing
'Open word document and display in MSG
'box the document propertys'
'Defined strA many different ways with
'not luck
'Run time error 122 - Type mismatch
Dim wd As Object
Dim strA As String
Dim intB As Integer
Dim strB As String
Dim intCount As Integer
Set wd = CreateObject("Word.Basic")
wd.FileOpen "a:SummaryTest.doc"
For Cnt = 1 To wd.CountDocumentProperties()
strA = wd.DocumentPropertyName$(Cnt)
If wd.DocumentPropertyType(strA) = 1 Then
strB = wd.GetDocumentProperty(strA)
Else
'Run time error 122 - Type mismatch
strB = wd.GetDocumentProperty$(strA)
MsgBox "Property " & strA & " = " & strB
End If
Next
wd.FileClose 2
Set wd = Nothing