textrange

Is there a way selecting MULTIPLE areas of text with JS in Chrome and/or IE?

▼魔方 西西 提交于 2020-01-14 10:10:04
问题 Firefox 3 can select MULTIPLE areas of text with JS. Is there a way doing this in Chrome and IE? I really tried to find a way to select of multiple textareas in a web page in Chrome and IE9. Infos at: http://help.dottoro.com/ljxsqnoi.php Example at: http://jsfiddle.net/t3sWz/ Code FireFox3.5+ only... (but this is the question): <html> <head> <meta charset="UTF-8"> <style> #trigger { background: yellow } </style> </head> <body> <p id="test"> This is some text you can highlight by dragging or

Is there a way selecting MULTIPLE areas of text with JS in Chrome and/or IE?

余生颓废 提交于 2020-01-14 10:04:23
问题 Firefox 3 can select MULTIPLE areas of text with JS. Is there a way doing this in Chrome and IE? I really tried to find a way to select of multiple textareas in a web page in Chrome and IE9. Infos at: http://help.dottoro.com/ljxsqnoi.php Example at: http://jsfiddle.net/t3sWz/ Code FireFox3.5+ only... (but this is the question): <html> <head> <meta charset="UTF-8"> <style> #trigger { background: yellow } </style> </head> <body> <p id="test"> This is some text you can highlight by dragging or

How to concatenate multiple FlowDocuments together into 1 FlowDocument

▼魔方 西西 提交于 2020-01-03 04:44:06
问题 I have multiple FlowDocuments that I would like to concatenate together. The method below doesn't have a return statement. What I would like to do is to turn the TextRange back into a FlowDocument. private FlowDocument Concatenate(FlowDocument source, FlowDocument target) { using(MemoryStream ms = new MemoryStream()) { TextRange tr = new TextRange(source.ContentStart, source.ContentEnd); tr.Save(ms, DataFormats.XamlPackage); ms.Seek(0, SeekOrigin.Begin); tr = new TextRange(target.ContentEnd,

Inserting text into an editable IFRAME at the caret position (IE)

无人久伴 提交于 2019-12-28 16:26:28
问题 I'm struggling with an actually straighforward problem: In Internet Explorer I want to insert plain text at the current caret position. This works really fine for simple TEXTAREA elements but it doesn't entirely work for editable IFRAMEs, which is what I have. In the script I use I am creating a TextRange object from the document of the IFRAME which I use to paste the text as HTML at the cursor position. <iframe id="editable"> <html> <body> Some really boring text. </body> </html> </iframe>

highlight text on single click (javascript jquery html)

守給你的承諾、 提交于 2019-12-22 22:32:30
问题 When you double click on a word in all browsers, they automatically highlight the word under the click. But is it possible to find a way to have the exact same thing happen on a single click? I imagine things involved in this might be: - TextRange stuff; - Reacting to onclick for all paragraphs (or whole body or div), ... but then I have not found anywhere that says how you could tell the browser: "Hey! Please do that cool thing of highlighting text right under the mouse ... RIGHT NOW ...

TextRange offsetLeft and offsetTop broken in Internet Explorer 8 Standards Mode (IE8)

最后都变了- 提交于 2019-12-13 12:03:29
问题 I seem to have found an issue with Internet Explorer 8, when finding the position of a Text Range - For instance the currently selected text. I have not found been able to find any reports of this issue on StackOverflow or elsewhere. TextRange.offsetLeft and TextRange.offsetTop report the left and top corner of the range, and in all cases I have seen in IE8, they are roughly correct, except in the case when the range is within an IFrame . When the range is within an IFrame the values for

How can I change the font color of a TextRange in PowerPoint from C#?

梦想的初衷 提交于 2019-12-12 10:43:06
问题 I created a PowerPoint presentation using C#: PowerPoint.Application powerpointApplication; PowerPoint.Presentation pptPresentation; PowerPoint.Slide Slide; // Create an instance of PowerPoint. powerpointApplication = new PowerPoint.ApplicationClass(); // Create a PowerPoint presentation. pptPresentation = powerpointApplication.Presentations.Add( Microsoft.Office.Core.MsoTriState.msoTrue); // Create empty slide Slide = pptPresentation.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutBlank);

Get paragraph no where txt is found, and move text to end of paragraph using Word 2010 vba

北城余情 提交于 2019-12-11 13:59:25
问题 I am trying to use VBA to move a rich text clause ("strText"), which appears at the beginning of various paragraphs, to the end of each paragraph where the clause appears, and thereafter to underline strText. I am a novice/hobbyist at vba programming, so please be gentle. I spent a few days on this before seeking help. Problems with my attempted coding (which appears below): I tried to assign to var "LparaNo" the number of the paragraph wherein the found text (strText) appears. But the number

getting offsetLeft of a text range

那年仲夏 提交于 2019-12-10 16:36:55
问题 Can anyone tell me why this code is returning undefined . I was hoping this would give the left coordinate of the user selected text. function alertRangeObject(){ var userSelection; if(window.getSelection) { userSelection = window.getSelection(); } else if (document.selection) { userSelection = document.selection.createRange(); } var selectedText = userSelection; if (userSelection.text) { selectedText = userSelection.text; } var rangeObject = getRangeObject(userSelection); function

Set specific text to bold in WPF RichTextBox

我的未来我决定 提交于 2019-12-10 13:45:50
问题 I am extending the functionality of a WPF Richtextbox. I want certain text to become bold when I type it in. I was able to get certain text to bold but the text following the bolded word would also become bolded... Heres a sample of my code: private bool _Running = false; void CustomRichTextBox_TextChange(object sender, TextChangedEventArgs e) { if(_Running) return; _Running = true; //Logic to see if text detected //Logic to get TextPointers //Logic to get TextRange var boldMe = new TextRange