Microsoft Office Tutorials and References
In Depth Information
Adding a page as a background for another page
// Set the page height property
PacktShape.get_Cells("PageHeight").Formula = "3 in";
// Adding the page for background
Visio.Page PacktBgPage = Application.ActiveDocument.Pages.Add();
// Set the name for new page
PacktBgPage.Name = "Packt Page BackGround";
//Set the background code property
PacktBgPage.Background = 3;
// The new page will be the backgroud for the current page
Application.ActiveDocument.Pages[1].BackPage = PacktBgPage.Name;
// New shape instance
Visio.Shape PacktTextShape = null;
// Read the page of the current document
PacktTextShape = PacktVisioDocument.Pages[2].PageSheet;
// Create rectangle
PacktTextShape.DrawRectangle(1.0, 10.0, 3.0, 10.5);
// Set the text style
PacktTextShape.TextStyle = "Normal";
// Set the line style
PacktTextShape.LineStyle = "Text Only";
// New instance of Character object
Visio.Characters PacktText = null;
// Assign the characters of the shape to the Visio character object
PacktText = Application.ActiveDocument.Pages[2].Shapes.
get_ItemFromID(PacktTextShape.ID+1).Characters;
// Set the begin point
PacktText.Begin = 0;
// Set the end point
PacktText.End = 25;
// Text for the rectangle
PacktText.Text = "My First BOOK";
}
The page that is acting as the background page has a rectangular shape that contains
the text, My First BOOK on it. You can see the following screenshot when you click
the Page-1 tab:
 
Search JabSto ::




Custom Search