简体   繁体   中英

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.

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?

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.

Any help/suggestions/links are very appreciated.

This will find the "SearchId" within the stringsearch and extract everything after it into "link".

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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