What is the recommended what to pragmatically add text to a Word document using...


What is the recommended what to pragmatically add text to a Word...
Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Mike,
When do you get this message? In general the rich text view should not display "save as" message. You can clear the Modified document flag:
richTextView.document.Modified = false;
if you want to suppress it, but we're just curious how do you get it in the first place... 

Best Regards,
Nevron Support Team


Mike Willis
Mike Willis
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
Posts: 18, Visits: 109
Thanks that worked perfectly.
One more thing.  When i add the text i get a Save prompt.  How can i suppress the save prompt?
Thanks in advance
Mike willis 
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Mike,
We recommend to add the text as it should be present in control DOM tree - for example:
   NRichTextView richTextView = (NRichTextView)nRichTextViewWithRibbonControl1.Widget.GetFirstDescendant(NRichTextView.NRichTextViewSchema);
    richTextView.Content.Sections.Clear();

    NSection section = new NSection();
    richTextView.Content.Sections.Add(section);

    NParagraph paragraph = new NParagraph();
    section.Blocks.Add(paragraph);

    NTextInline boldInline = new NTextInline("Bold Text.");
    boldInline.FontStyleBold = true;
    paragraph.Inlines.Add(boldInline);

    NTextInline italicInline = new NTextInline("Italic Text.");
    italicInline.FontStyleItalic = true;
    paragraph.Inlines.Add(italicInline);
in short you need to create a section (controls pages) and then add paragraphs or tables to it. For more information you can check out Rich Text Editor \ Document Model topics which describe how a document is structured. 
Hope this helps - let us know if you meet any problems or have any questions.




Best Regards,
Nevron Support Team


Mike Willis
Mike Willis
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
Posts: 18, Visits: 109
I need to add fake data (Lorem) to my word documents.
What is the best way to accomplish this?
Thanks in advance.
Mike
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search