Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can UserDocuments be passed as arguments to funtions & sub routines?

1 view
Skip to first unread message

SA

unread,
Mar 8, 2000, 3:00:00 AM3/8/00
to
I'm trying to pass an ActiveX user document object to a sub routine, but I get a Type mismatch error 13. The following are code examples:
 
 
This sub routine is defined on the UserDocments:
__________________________________________________________________
Private Sub UserDocument_Show()
    ' I have tried three methods
   
    ' Method 1
    Dim MyDoc as UserDocument
    Set MyDoc = Me ' This produces a type mismatch
 
    EnableDisable MyDoc, False
 
    ' Or Method 2
    EnableDisable UserDocument, False ' Produces Type mismatch
 
    ' Or Method 3
    EnableDisable Me, False  ' Produces Type mismatch
End Sub
__________________________________________________________________
 
 
Routine defined in global module or enable or disable all controls on the UserDocument:
__________________________________________________________________
Public Sub EnableDisable (ThisDoc as UserDocument, bEnable as Boolean)
    Dim DocControl as Control   
    For each DocControl in ThisDoc
        DocControl.Enable = bEnable
    Next
End Sub
__________________________________________________________________
 
 
Is this even possible? Or am I not understanding something about the UserDocument object
0 new messages