0
我正在使用Microsoft.Office.Interop.Word讀取Word文檔中的文本並返回文件中的每個單詞。在Word文檔中,有一個電子郵件地址,不幸的是我沒有收到完整的電子郵件地址。例如:電子郵件地址是[email protected],但我得到(1)abc(2)@(3)xyz(4)。 (5)的COM。Microsoft.Office.Interop.Word無法返回完整的電子郵件地址
如何使用的Microsoft.Office.Interop.Word得到完整的電子郵件地址?謝謝。
代碼:
Microsoft.Office.Interop.Word.Application application = new Microsoft.Office.Interop.Word.Application();
Document document = application.Documents.Open(txtUploadedPathToken.Text);
// Loop through all words in the document.
int count = document.Words.Count;
foreach (Microsoft.Office.Interop.Word.Range range in document.Words)
{
string text = range.Text;
tableLayoutPanel2.Controls.Add(new Label() { Text = text, Anchor = AnchorStyles.Left, AutoSize = true });
}
向我們展示你的代碼。 – SLaks
@SLaks,我已更新我的問題,包括代碼 – user3248886