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
|
try
|
||||||
{
|
{
|
||||||
_WordApp.Quit(false);
|
_WordApp.Quit();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -89,22 +89,46 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 0);
|
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 0);
|
||||||
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 1);
|
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 1);
|
||||||
txbWrdText.Text = _WordApp.Selection.Text;
|
try
|
||||||
txvStyle.Text = _WordApp.Selection.Style.NameLocal;
|
{
|
||||||
txbLevel.Text = _WordApp.Selection.Style.ListLevelNumber.ToString();
|
int idx = _WordApp.Selection.Text.IndexOfAny("\t".ToCharArray());
|
||||||
//_WordApp.Selection.Copy();
|
if (idx > 0)
|
||||||
Clipboard.SetText(txbWrdText.Text);
|
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)
|
private void btnNext_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 0);
|
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 0);
|
||||||
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1);
|
_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1);
|
||||||
txbWrdText.Text = _WordApp.Selection.Text;
|
try
|
||||||
txvStyle.Text = _WordApp.Selection.Style.NameLocal;
|
{
|
||||||
txbLevel.Text = _WordApp.Selection.Style.ListLevelNumber.ToString();
|
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();
|
//_WordApp.Selection.Copy();
|
||||||
Clipboard.SetText(txbWrdText.Text);
|
//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
|
try
|
||||||
{
|
{
|
||||||
if (_WordApp != null)
|
if (_WordApp != null)
|
||||||
_WordApp.Quit(false);
|
_WordApp.Quit();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user