How to return the maximum XPOS and YPOS coordinates for the DROP method

Started by jshiangoli, January 05, 2010, 12:21:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jshiangoli

Hi All
The drop method for a visio shape requires the X and Y coordinates as illustrated below

Shape _visioShape = _visioPage.Drop(_visioMasterName,X,Y);

I would like to know how I can programatically return the maximum values for X and Y for a given page.

Your help would be greatly appreciated

Regards
John

Paul Herber

There is no maximum as such, however, you probably want to get the current page size:


  size = page.PageSheet.CellsU['PageWidth'].Result["mm"];
or
  size = page.Document.PaperWidth["mm"];

will get you started.
Oh yes, the X and Y in the Drop method are in inches so divide by 2.54 to convert mm to inches.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visio Guy

And if you don't mind working with inches, you can use .Cells("somecell").ResultIU (takes no arguments).
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

jshiangoli

Hi
Thank you for your help. I'm using Visio 2007 and could only locate the following

double _visioPageWidthMM = _visioPage.Document.get_PaperWidth("mm");
double _visioPageHeightMM = _visioPage.Document.get_PaperHeight("mm");

which is slightly different.
Regards
John

Paul Herber

Different languages (C++, C#, VBA, Delphi) show these slightly differently, all much of a muchness.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/