Profile Picture

What is the best what to copy text from one document to another

Posted By Mike Willis 4 Years Ago

What is the best what to copy text from one document to another

Author
Message
Mike Willis
Posted 4 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 18, Visits: 109
Hi,
I am using OpenVision Enterprise
What is the recommended way to copy text from one document to another, both opened in memory?
Specifically i want to do a mail merge in one document, and copy the resulting merge to another document.
Thanks, 
Mike Willis



Nevron Support
Posted 4 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Mike,
There are generally two ways to do this fast:
1. You can use deep clone on the view.Content for example:
NDocumentBlock block = (NDocumentBlock)nRichTextViewWithRibbonControl1.View.Content.DeepClone();
nRichTextViewWithRibbonControl2.View.Content = block;
or 
2. You can save / load the document to a memory stream:
MemoryStream memoryStream = new MemoryStream();
nRichTextViewWithRibbonControl1.View.SaveToStream(memoryStream, new NNevronXMLTextFormat(), null);
memoryStream.Seek(0, SeekOrigin.Begin);
nRichTextViewWithRibbonControl2.View.LoadFromStream(memoryStream, new NNevronXMLTextFormat());

We would recommend you to use the first approach as there is no added overhead of XML formatting. Let us know if you have any questions.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic