![]() |
|
#2
|
||||
|
||||
|
You need to define strsubject e.g.
Code:
Dim strSubject As String 'this line already in macro
Dim oPara As Range
Dim lngPara As Long
For lngPara = 1 To ActiveDocument.Paragraphs.Count
Set oPara = ActiveDocument.Paragraphs(lngPara).Range
If Left(LCase(oPara.Text), 3) = "re:" Then
oPara.End = oPara.End - 1
oPara.MoveStartUntil Chr(32)
oPara.Start = oPara.Start + 1
strSubject = oPara.Text
Exit For
End If
Next lngPara
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
| Tags |
| email, letter, ms-word |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Adding document fields to subject line of email
|
russkris | Word VBA | 3 | 09-24-2017 08:18 PM |
| Populating a Word document with VBA\SQL | shabbaranks | Mail Merge | 23 | 07-21-2015 01:31 PM |
run word doc when a email is received with a certain subject based on rules
|
megatronixs | Outlook | 3 | 10-18-2014 11:47 AM |
Program to read Email subject line word by word
|
john23# | Outlook | 1 | 02-14-2014 10:21 PM |
| Lack of email addresses auto-populating | LarryK | Outlook | 0 | 10-10-2012 08:09 AM |