Aaron,
the basic shape manipulation hasn't changed a great deal since then. The
major changes is in event handling. More important is what version of
timeline addon is installed in v2000????
' modDropMasterOnPage / DropMasterOnPage.bas
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' Summary:
' This module demonstrates how to drop a master onto a page at a
' specific location.
Public Function DropMasterOnPage(vsoPage As Visio.Page, _
strMasterNameU As String, _
strStencilName As String, _
dblPinX As Double, _
dblPinY As Double, _
varUnits As Variant) As Visio.shape
' DropMasterOnPage
'
' Abstract - This function finds the document with the
' strStencilName parameter from the Documents collection.
' If the document is not open, then open the stencil. Find
' the master within that stencil and drop it on to the page.
'
' Parameters
' vsoPage The page where the master will be dropped
' strMasterNameU Universal name of master in the stencil
' strStencilName Name of the Stencil from which the master
' is to be found
' dblPinX X-coordinate of the Pin in varUnits units
' dblPinY Y-coordinate of the Pin in varUnits units
' varUnits Units used by dblPinX and dblPinY
'
' Return Value Shape that was created by dropping the master on the page
' indicated by the vsoPage parameter
Dim vsoApplication As Visio.Application
Dim vsoDocuments As Visio.Documents
Dim vsoDocument As Visio.Document
Dim vsoMaster As Visio.Master
Dim dblPinXInternal As Double
Dim dblPinYInternal As Double
Dim vsoCellPinX As Visio.Cell
Dim vsoCellPinY As Visio.Cell
On Error Resume Next
' Find the stencil in the Document collection by name.
Set vsoDocuments = vsoPage.Application.Documents
Set vsoDocument = vsoDocuments.Item(strStencilName)
' If the stencil is not there, open it as a
' docked stencil.
If vsoDocument Is Nothing Then
Set vsoDocument = vsoDocuments.OpenEx( _
strStencilName, visOpenDocked)
End If
On Error GoTo DropMasterOnPage_Err
' Get the master on the stencil by using its universal
' name.
Set vsoMaster = vsoDocument.Masters.ItemU( _
strMasterNameU)
' Convert the PinX and PinY into internal units
Set vsoApplication = vsoPage.Application
dblPinXInternal = vsoApplication.ConvertResult(dblPinX, _
varUnits, visInches)
dblPinYInternal = vsoApplication.ConvertResult(dblPinY, _
varUnits, visInches)
' Drop the master on the page that is passed in.
' Set the PinX and PinY using the parameters
' dblPinXInternal and dblPinYInternal respectively.
Set DropMasterOnPage = vsoPage.Drop(vsoMaster, _
dblPinXInternal, dblPinYInternal)
' Update the units of the shape's PinX and PinY
Set vsoCellPinX = DropMasterOnPage.CellsSRC(visSectionObject, _
visRowXFormOut, visXFormPinX)
Set vsoCellPinY = DropMasterOnPage.CellsSRC(visSectionObject, _
visRowXFormOut, visXFormPinY)
vsoCellPinX.result(varUnits) = dblPinX
vsoCellPinY.result(varUnits) = dblPinY
Exit Function
DropMasterOnPage_Err:
Debug.Print Err.Description
End Function