Added logic to trim the copied text after the first tab character
This commit is contained in:
parent
01f7850964
commit
067351f47a
@ -45,7 +45,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
try
|
||||
{
|
||||
_WordApp.Quit(false);
|
||||
_WordApp.Quit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -89,22 +89,46 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 0);
|
||||
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 1);
|
||||
try
|
||||
{
|
||||
int idx = _WordApp.Selection.Text.IndexOfAny("\t".ToCharArray());
|
||||
if (idx > 0)
|
||||
txbWrdText.Text = _WordApp.Selection.Text.Substring(0, idx);
|
||||
else
|
||||
txbWrdText.Text = _WordApp.Selection.Text;
|
||||
txvStyle.Text = _WordApp.Selection.Style.NameLocal;
|
||||
txbLevel.Text = _WordApp.Selection.Style.ListLevelNumber.ToString();
|
||||
//_WordApp.Selection.Copy();
|
||||
Clipboard.SetText(txbWrdText.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
|
||||
private void btnNext_Click(object sender, EventArgs e)
|
||||
{
|
||||
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 0);
|
||||
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1);
|
||||
try
|
||||
{
|
||||
int idx = _WordApp.Selection.Text.IndexOfAny("\t".ToCharArray());
|
||||
if (idx > 0)
|
||||
txbWrdText.Text = _WordApp.Selection.Text.Substring(0, idx);
|
||||
else
|
||||
txbWrdText.Text = _WordApp.Selection.Text;
|
||||
txvStyle.Text = _WordApp.Selection.Style.NameLocal;
|
||||
txbLevel.Text = _WordApp.Selection.Style.ListLevelNumber.ToString();
|
||||
//_WordApp.Selection.Copy();
|
||||
Clipboard.SetText(txbWrdText.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
//_WordApp.Selection.Copy();
|
||||
//string tmp = Clipboard.GetText(TextDataFormat.Html);
|
||||
//EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
|
||||
//while (ei.Enabled == false)
|
||||
// ei = ei.MyParentEditItem ?? ei.MyPreviousEditItem;
|
||||
//ei.MyStepRTB.Focus();
|
||||
|
||||
}
|
||||
|
||||
@ -118,7 +142,7 @@ namespace Volian.Controls.Library
|
||||
try
|
||||
{
|
||||
if (_WordApp != null)
|
||||
_WordApp.Quit(false);
|
||||
_WordApp.Quit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user