I'm new in c# and in Corel. I try to use .PageChange commend. Maybe can i change page by name?. I have 22 pages in document.
CorelDRAW.Application cdr = new CorelDRAW.Application(); cdr.Visible = false; cdr.OpenDocument(@"C:\software\Corel\xxxx.cdr"); cdr.ActiveDocument.Activate(); cdr.ActiveDocument.PageChange += ??? MessageBox.Show(cdr.ActivePage.Name);
What do you want accomplishing trying to use `PageChange`? Such a propery does not exist for a document object... Can you explain what do you need. Besides that, 'ActiveDocument.Activate` do not make to much sense...
Do you want changing of the page size?
I read a little bit and now i know how too change page :]
Layer lrIT1 = cdr.ActiveDocument.Pages.Layers.Find("txt");
you can change page by index, using
cdr.ActiveDocument.Pages(32).Activate , here 32 - page number
ActiveDocument.PageChange is a user redefined routine, you can use it to track PageChange event
If you want to activate a page by its name you can do this with those lines:I'm not familiar with C++, I'm using VBA. But I guess, you can read out of the lines the way you can do it.Dim CurDoc As Document, CurPg As Page, Pg As PageSet CurDoc = ActiveDocumentFor Each Pg In CurDoc.Pages If UCase(Pg.Name) = "MYPAGE" Then Set CurPg = Pg CurPg.Activate End IfNext PgBut you should be aware, that CD allows more pages with the same name in a document!