-
Solved: Type Mismatch
Hi,
I'm new here...
Did an extensive search at Microsoft, the Internet an a quick one here
Can't find what I'm looking for.
My code:
Sub test()
'Word VBA 2002; Option Explicit
Dim aCustProp As CustomProperty
'type mismatch
For Each aCustProp In ActiveDocument.CustomDocumentProperties
MsgBox aCustProp.Value
Next aCustProp
Dim aDocVar As Variable
'NO type mismatch
For Each aDocVar In ActiveDocument.Variables
MsgBox aDocVar.Value
Next aDocVar
End Sub
First For Next Loop gives a type mismatch; second one is OK
Drives me crazy. Any ideas?
PS: Great to have a formum on VBA!!!
regards,
Luke
-
Luke,
Declare it as a Documentproperty
[vba]
Dim aCustProp As DocumentProperty
[/vba]
-
Wow...
Fast AND right..
thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules