Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 2.28 KB

Visio.Document.Drop.md

File metadata and controls

64 lines (41 loc) · 2.28 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Document.Drop method (Visio)
vis_sdr.chm10516235
vis_sdr.chm10516235
Visio.Document.Drop
1e6b2d14-71c2-4adc-a9d7-ec123b2b7f31
06/08/2017
medium

Document.Drop method (Visio)

Creates a new Master object by dropping an object onto a receiving object such as a stencil or document, or the Masters or MasterShortcuts collection.

Syntax

expression.Drop (ObjectToDrop, xPos, yPos)

expression A variable that represents a Document object.

Parameters

Name Required/Optional Data type Description
ObjectToDrop Required [UNKNOWN] The object to drop. While this is typically a Visio object such as a Master, Shape, or Selection object, it can be any OLE object that provides an IDataObject interface.
xPos Required Integer The x-coordinate at which to place the center of the shape's width or PinX.
yPos Required Integer The y-coordinate at which to place the center of the shape's height or PinY.

Return value

Master

Remarks

Using the Drop method is similar to moving a shape with the mouse. The object dropped ( ObjectToDrop) can be a master or a shape on the drawing page.

If ObjectToDrop is a Master, the pin of the master is dropped at the specified coordinates. A master's pin is often, but not necessarily, at its center of rotation.

To create a new master in a stencil, apply the Drop method to a Document object that represents a stencil (the stencil must be opened as an original or a copy rather than read-only). In this case, the xPos and yPos arguments are ignored, and the new master that is created is returned.

Example

The following example shows how to use the Drop method to create a master by dropping a shape onto a Document object.

 
Public Sub Drop_Example() 
 
    Dim vsoShape As Visio.Shape  
    Dim vsoMaster As Visio.Master  
 
    Set vsoShape = ActivePage.DrawRectangle(1, 2, 2, 1)  
 
    'Create a master in the document.  
    'The master appears on the document stencil.  
    Set vsoMaster = ActiveDocument.Drop(vsoShape, 0, 0)  
 
End Sub

[!includeSupport and feedback]