![]() |
|
#1
|
|||
|
|||
![]() Quote:
Yes. Thanks for the codes. With a quite careful look at them, I notice ya've used two Code:
With .Content End With Meanwhile, I'm using Code:
.Find.Wrap = wdFindContinue Code:
Sub Macro1() Dim Str1 As String, Str2 As String Dim Rng As Range With ThisDocument With .Content With .Find .ClearFormatting .MatchWildcards = True .Execute FindText:="The Principal" End With If .Find.Found Then Set Rng = .Duplicate.Paragraphs.Last.Next.Range With Rng While Not .Characters.Last Like "[a-z]" .End = .End - 1 Wend Str2 = .Text End With End If With .Find .ClearFormatting .MatchWildcards = True .Wrap = wdFindContinue .Execute FindText:="RE: [!13]@^13" End With If .Find.Found Then Set Rng = .Duplicate With Rng While Not .Characters.Last Like "[a-z]" .End = .End - 1 Wend .Start = .Start + Len("RE: ") Str1 = .Text End With End If End With End With Debug.Print Str1 & " " & Str2 End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Visual Basic error - run time error 504 | crazymorton | Word | 11 | 01-13-2012 04:32 AM |
![]() |
bennypryde | Office | 1 | 01-05-2012 03:33 PM |
Ms Word Error | manesh | Word | 1 | 05-28-2010 07:26 AM |
Runtime error 5487 - Word cannot complete the save to to file permission error | franferns | Word | 0 | 11-25-2009 05:35 AM |
Receive error cannot open this form because an error occurred in BCM 2007 | bornhusker | Outlook | 0 | 06-01-2009 10:28 AM |