![]() |
|
#1
|
|||
|
|||
|
i have a document with many paragraphs. all formated like:
T: ... P: ... T: ... fist i delete all paragraphs with T: at the beginning with a macro that delete text between two words: ------------------------------------ Sub DeleteTextBetweenTwoWords() Dim strFirstWord As String Dim strLastWord As String Dim objDoc As Document Dim objWord As Object Set objDoc = ActiveDocument strFirstWord = "T:" strLastWord = "P:" With Selection .HomeKey Unit:=wdStory With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = strFirstWord & "*" & strLastWord .Replacement.Text = strLastWord .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End With Set objDoc = Nothing Set objWord = Nothing End Sub ------------------------------------------ the result is that i only get the paragraphs with P: at the beginning. how can i split now the remaining paragraphs after, for example, 50 words? |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to find (highlight) two and more words in a list of 75k single words in Word 2010 | Usora | Word | 8 | 05-29-2018 03:34 AM |
Capitalize one to two words if they are the only words on a line
|
jrhlavac | Word VBA | 1 | 10-08-2015 08:19 PM |
How to mark underlined words in a sentence as A, B, C, D (beneath the words)
|
thudangky | Word | 13 | 12-12-2013 02:22 AM |
Spliting column with text and numbers
|
mjosic | Excel | 3 | 04-04-2012 05:56 AM |
| Why Words doesn’t show the style of the selected words automatically???? | Jamal NUMAN | Word | 0 | 04-14-2011 03:20 PM |