VBOffice

Hide Text in Email

You can hide a text in an email by using a bookmark.

Last modified: 2016/05/25 | Accessed: 26.332  | #158
◀ Previous sample Next sample ▶
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.

By using bookmarks you can collapse and expand text in an email. Select any text in your email, click Insert, Bookmark, and name the bookmark. In the code enter the name of the bookmark under the comment line between the quotes. You can start the macro by pressing alt+f8.

The sample works with Outlook 2007 and higher. It could also work for the older versions of Outlook if you set Word as mail editor.


tip  How to add macros to Outlook
Public Sub CollapseExpandText()
  Dim Ins As Outlook.Inspector
  Dim Document As Object 'Word.Document
  Dim Bm As Object 'Word.Bookmark
  Dim Fn As Object 'Word.Font
  
  Set Ins = Application.ActiveInspector
  Set Document = Ins.WordEditor
  'Here enter the name of the bookmark
  Set Bm = Document.Bookmarks("HideText")
  Set Fn = Bm.Range.Font
  Fn.Hidden = Not Fn.Hidden
End Sub
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.
email  Send a message