简体   繁体   English

在某个outlook邮件中打开一个url

[英]Open an url in a certain outlook mail

I am writing a vba script to open a particular mail from outlook and then open a link in that mail.我正在编写一个 vba 脚本来打开来自 outlook 的特定邮件,然后打开该邮件中的链接。

So far I have only achieved the first part.到目前为止,我只实现了第一部分。 How do I get vba to test which part of the body is a hyper link and to open it?如何让 vba 测试正文的哪一部分是超链接并打开它?

Dim stringsearch As String
 stringsearch = oMsg.Body

So now the searchstring contains the body text of the mail.所以现在搜索字符串包含邮件的正文。

I know that the link will always begin with the phrase "SearchID" and will always be the last line of the mail.我知道该链接将始终以短语“SearchID”开头,并且始终是邮件的最后一行。

Any help/suggestions/links are very appreciated.非常感谢任何帮助/建议/链接。

This will find the "SearchId" within the stringsearch and extract everything after it into "link".这将在字符串搜索中找到“SearchId”并将其后的所有内容提取到“链接”中。

dim linkLoc as Integer
linkLoc = instr(1, stringsearch, "SearchID")
dim link as string
link = mid(stringsearch, linkLoc + 8)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM