Copy Section/Page

Technical support for Spire.Doc

Moderator: iceblue support

Copy Section/Page

Postby rbrynteson » Wed Jun 20, 2012 4:00 am

First off, this is a really great tool and I think it's exactly what I've been looking for. I have two items remaining to figure out - I think I'm close on one of them but here is my second issue.

Is there a way to copy a page of a word template and then target that page to change contents. Here is what I'm basically trying to do. Let's say page 5 consists of a table and page 6 is a graph of information. I want to iterate through a set of table (let's say 6 items) where I would copy page 5 and 6, the five times (to get to 6 copies of it) and then customize that content on each page.

Hopefully that makes sense. Any suggestions would be great. I'll keep playing with it.

Thanks,

Richard
rbrynteson
 
Posts: 11
Joined: Wed Jun 20, 2012 3:58 am

Re: Copy Section/Page

Postby nancy » Wed Jun 20, 2012 6:12 am

Hi Richard,

As the issue you reported, we have created a research on it, but we need some more time to fix it. You will be surely informed once we fix it.
Have a nice day!

----------------------------------------------------------------------------------------------------
Nancy
e-iceblue support
Nancy
e-iceblue support team
contact: nancy.wang@e-iceblue.com
User avatar
nancy
 
Posts: 51
Joined: Wed May 30, 2012 2:02 am

Re: Copy Section/Page

Postby rbrynteson » Sat Jun 23, 2012 3:31 am

That was too easy. Found the following:

Section copySection = document.Sections[4];
document.Sections.Add(copySection.Clone());

Where Sections[4] was the fifth page and the one I wanted to copy.

[edit]
So the follow up to this is after I've copied a page, I wanted to edit the content on simply one of those pages. I did this through using something like this:

ISection pg1 = document.Sections[4];
IParagraph p0 = pg1.Paragraphs[0];
p0.Replace("<<Measure>>", qryReport.Rows[i]["expr2"].ToString(), true, true);

Hope it helps someone else.

DJ
rbrynteson
 
Posts: 11
Joined: Wed Jun 20, 2012 3:58 am

Re: Copy Section/Page

Postby nancy » Wed Jun 27, 2012 8:26 am

Hi rbrynteson,

Thank you for sharing codes. :)
----------------------------------------------------
Nancy
e-iceblue.com
Nancy
e-iceblue support team
contact: nancy.wang@e-iceblue.com
User avatar
nancy
 
Posts: 51
Joined: Wed May 30, 2012 2:02 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests

cron