I have a document with reports in it and I want to copy a block structure from this document to a new document in it.
I try this but it seems to be not functional (may I have to wait because it takes too much time).
Here is a snippet of my code:
Set Doc = Application.ActiveDocument
Set My_reports = Doc.Reports
Set ReportTest = My_reports.Add
ReportTest.Name = "test"
Set sections = My_reports(1).GeneralSectionStructure
Set sections1 = ReportTest.GeneralSectionStructure
Set sections1 = sections
I just want to know if it is possible to programmatically copy a block from one report to another or from one document to another.
Thanx for your answers.
Taze.
You can do this with a template. If you look at this download you’ll see how Dwayne copied content from one document to another document, or even from one report tab to another report tab within the same document.
Thank you Dave.
The problem is that the copy concern just the data and not the blocks (tables, cross tables, graphs,cells,…).
My problem is that I want to copy a formatted block (with its colors, fonts, etc…) from a report to a new one.
Thanx…
Thank you Dave,
So it seams that it’s not possible to copy a table,cross-tab or graph from one report to another.
So with BO it is just possible to copy “data” but not “graphical structure”.
If I’m wrong pleae correct me.
Taze.
As far as I know, it’s not possible to copy data blocks using VBA. Or at least I have not found a way how to do it. And I tried few times. Would love to know if there is a way but I am a bit skeptic that it’s not possible.
where are you trying to do it? WebI to WebI doc/reports?
if your answer is Yes then answer is YES, you should be able to…the trick is, you need to navigate on document structure before you can traverse the child/ren under it.
i’m sorry that i might not be able to provide a sample code but i’ve done it on my previous project…you can even thread multiple blocks coming from different documents and save it into a totally new document…in doing that you would also need to create/build the DPs that corresponds to the block/s.