How to create a Page from vgcore.page object

Former Member
Former Member

Hello,

i want to store a whole page in a variable i do it this way:

VGCore.Page myPage = doc.Pages.First;

Later i want to assign this Page to another document but i don't find a function for that...  i wanna do something like

doc.Pages.add(myPage)

  • What you are trying to do is strange...

    In your first line of code you just set a reference to the first page of the doc document. You can only use it like:

    int x = myPage.Shapes.Count;  string y = myPage.Name; VGCore.ShapeRange Sh = myPage.Shapes.All

    Returning the number of shapes in the referenced page, its name and a ShapeRange reference.

    If you imagine that myPage varible keeps the content of that specific page you are wrong! You can add an empty page and after that to copy the content of myPage. But you firstly must understand the meaning of what you do against what you intend to do...

  • You cannot copy a page from one document to another. It is not supported. A couple work around that may work for you.

    You could copy and paste from one page to another, its slow I wouldn't recommend it.

    You can use the CreateDocumentFrom which will create a new document from your shape or shaperange. it creates a new document so this may not work for you depending on what you are trying to do.

    Finally, you can save your current selection, then import that file into your other document. I have found this works best and is the fastest.

    I have seen some other ways tried but they are not stable so I will not mention them here. If you are interested you may search for them over on OberonPlace.com

    -Shelby