JuneTheSecond said:
Hi Jeeban,
You have two different stencils.
Please make sure that you defined
"oStencilDoc" for each different stencil.
This is my test code in VBA.
Sub test()
Dim doc As Visio.Document
For Each doc In Application.Documents
If doc Is ActiveDocument Then
Debug.Print doc.Name
Else
Debug.Print doc.Name
ActivePage.Drop doc.Masters(1), 0, 0
End If
Next
End Sub
--
JuneTheSecond
Now, visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
no sir....
my code is working with other stencil fine ....
but only one stencil , it is creating problem.
all stencill are own made. . all stencilDocs are defined properly.
at a time i have to drop one symbols.. i have tested for 100 case. all r
fine but only one stencill causes error...
Inappropriate source for this action.
what could be the problem
Set oStencilDoc = mvarVisioApplication.Documents.OpenEx(StencilFilePath,
visOpenDontList + visOpenHidden + visOpenDocked)
' oStencilDoc = oVsApp.Documents.OpenEx(StencilPath,
VisOpenSaveArgs.visOpenDontList + VisOpenSaveArgs.visOpenHidden +
VisOpenSaveArgs.visOpenDocked) ' CShort(VisOpenSaveArgs.visOpenDontList))
Set oshape = oActiveWindow.Page.Drop(oStencilDoc.Masters(1),
mvarInsertPointX, mvarInsertPointY)
If Err <> 0 Then
MsgBox Err.Description & "Unable to Insert"
oStencilDoc.Close
oActiveWindow.WindowState = visWSMaximized
Exit Function
Err.Clear
End If
Is there any problem of the sshape or that stencill..
i think my code is fine, beacuse for other stencil it is fine...