D
damion
Hello,
I have a need to create n instances of the Visio Drawing control at runtime,
in VB6. A simple example use case might be: Select a folder and open all
Visio documents. In my case, it is imperative that all documents be loaded
into memory, rather than simply loading them as I use them. Is it possible
to do this? I've been trying something like the example, but the compiler
doesn't like it, complaining about an improper use of the New keyword. I
have also tried using the CreateObject function, but the compiler throws an
error, "ActiveX component can't create object". Any help would be most
appreciated.
Private Sub CreateNewVisioControl(VisioFile As String)
'create a new Visio Drawing Control and open the VisioFile with it.
Dim NewControl As DrawingControl
'compiler complains about the next line.
Set NewControl = New DrawingControl
NewControl.Src = VisioFile
'do more stuff here...
End Sub
I have a need to create n instances of the Visio Drawing control at runtime,
in VB6. A simple example use case might be: Select a folder and open all
Visio documents. In my case, it is imperative that all documents be loaded
into memory, rather than simply loading them as I use them. Is it possible
to do this? I've been trying something like the example, but the compiler
doesn't like it, complaining about an improper use of the New keyword. I
have also tried using the CreateObject function, but the compiler throws an
error, "ActiveX component can't create object". Any help would be most
appreciated.
Private Sub CreateNewVisioControl(VisioFile As String)
'create a new Visio Drawing Control and open the VisioFile with it.
Dim NewControl As DrawingControl
'compiler complains about the next line.
Set NewControl = New DrawingControl
NewControl.Src = VisioFile
'do more stuff here...
End Sub