diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.cs b/PROMS/Volian.Controls.Library/DSOTabPanel.cs index 575c3f89..2ce36554 100644 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.cs +++ b/PROMS/Volian.Controls.Library/DSOTabPanel.cs @@ -160,6 +160,21 @@ namespace Volian.Controls.Library bool wildCards = SearchString.Contains("?") || SearchString.Contains("*"); Console.WriteLine("find = {0}", find.Execute(SearchString, false, false, wildCards, false, false, true, LBWdFindWrap.wdFindContinue,null,null,null,false,false,false,false)); } + /// + /// Text will either replace current selection or be inserted at the current cursor position if no selection + /// + /// + public void InsertText(string txt) + { + if (txt == null || txt.Length == 0) return; //nothing to insert + // Get the Document + LBDocumentClass wordDoc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); + //This will get the selected range or just the current cursor position + LBSelection sel = wordDoc.Application.Selection; + // This will replace the selection or insert at current position + sel.Text = txt; + } + private string ShowException(Exception ex) { string sep = "\r\n ";