Can anyone help me out with the above issue?. I have checked the Visio VSTO websites and could not find any codes that accesses the needed page properties.
Much thanks.
try
{
var pages = Globals.ThisAddIn.Application.ActiveDocument.Pages;
foreach (var pg in pages)
{
Microsoft.Office.Interop.Visio.Page page = (Microsoft.Office.Interop.Visio.Page)pg;
page. // ?? <- how to access the page setup??
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
I think these options are available in the PageSheet, and not directly exposed as properties of the "page" object. You can try this:
page.PageSheet.Cells("PageWidth").Formula
page.PageSheet.Cells("PageHeight").Formula
page.PageSheet.Cells("DrawingResizeType").Formula
Also, there is Macro Recorder feature in Visio; when you are unsure how do a specific thing using API, you can turn it on, do that thing manually, and then examine the generated VBA code.