Profile Picture

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

Posted By Mike Willis 4 Months Ago

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

Author
Message
Mike Willis
Posted 4 Months 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: Last Month
Posts: 18, Visits: 106
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 Months Ago
View Quick Profile
Supreme Being

Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)Supreme Being (3,905 reputation)

Group: Forum Members
Last Active: 1 days ago @ 4:40 AM
Posts: 2,879, Visits: 3,044
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