【发布时间】:2017-12-19 01:23:44
【问题描述】:
收到 $exception 错误“”未找到类型“选择”的公共成员“文本”。”我正在使用 Visual Studio,并尝试在单击按钮时创建表单,它将从打开的 Outlook 电子邮件中抓取文本. 调用 emailbody.Text 时出错。我对 Visual Basic 很陌生,所以请放轻松,哈哈。任何帮助都非常感谢。
Private Sub Pull_info_Click(sender As Object, e As EventArgs) Handles Pull_info.Click
Dim myOlApp As Outlook.Application = New Outlook.Application
Dim myOlExp As Outlook.Explorer = myOlApp.ActiveExplorer
Dim myOlSel As Outlook.Selection = myOlExp.Selection
'Dim oMail As Outlook.MailItem
Dim emailbody As Object
emailbody = myOlSel
Dim regex As Regex = New Regex("Ticket\sNumber:\s(.*?)\s-")
Dim match As Match = regex.Match(emailbody.Text)
If match.Success Then
MsgBox(match.Value)
End If
End Sub
【问题讨论】:
标签: .net vb.net visual-studio