In Visio, shape is a shape, and shape is an object. To perform operations on the Shape attribute, you must first locate each shape and identify different types of shapes, the general steps and related functions are as follows:
1. Locate page
Visio. Page page = (visio. Page) visioform. axdrawingcontrol. Document. Pages [1] is in the form of a single page. 1 indicates the first page, instead of starting from 0 to the array.
2. traverse the shapes used,All shapes on the page are shape and placed in the shapes of the page object.
For (INT I = 1; I <= page. shapes. Count; I ++)
{
Shape sp = shapes [I];
} Note that the subscript of shape starts from 1.
3. Find the cell and use the cell method in shape to store various properties. By finding these cells, you can read and set the attributes on the row.
(1) UseCellssrcexists(Section,
Row,Column,Fexistslocally) Or
Cellexistsu (Localeindependentcellname,
Fexistslocally) To determine whether the cell to be used exists. The difference between them is that the former uses an index to locate the search, and the latter uses a name to locate the search;
(2) Use cellssrc (Section,Row,
Column) OrCellsu(Localeindependentcellname) To return the corresponding cell object;
(3) Use the Cell Object'sSet_result and get_ ResultTo perform read/write operations.