简体   繁体   中英

How to copy a part of an email subject and use it in the email body of a new mail which is based on QuickParts (Outlook, VBA)

is it possible to extract a specific part of the mail subject and use it in the QuickParts in Outlook?

You need to find the position of the string in this case first:

position = InStr(StringToSearch, StringToFind)

Then use Left to cut the string:

Result = Left(StringToSearch, position -1)

Or just start from the end:

Result = Right(StringToSearch, position)

The Outlook object model provides three main ways for working item bodies:

  1. Body - a string representing the clear-text body of the Outlook item.
  2. HTMLBody - a string representing the HTML body of the specified item.
  3. Word editor - the Microsoft Word Document Object Model of the message being displayed. The WordEditor property of the Inspector class returns an instance of the Document class from the Word object model which you can use to set up the message body.

You can read more about all these ways in the Chapter 17: Working with Item Bodies article. It is up to you which way is to choose to customize the signature in the message body.

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