![]() |
#1
|
|||
|
|||
![]()
Hello,
I need to select (and later on copy to other document) all the content between the Chapters 1.2 and 1.3. I've tried this but need some help to fix this, can someone help me on this? Thanks! Sub test() 'Select tekst between Chapter 1.2 and 1.3 Set WDoc = ActiveDocument For Each docfield In WDoc.Fields Select Case docfield.Type Case 88 Set objRange = docfield.Result 'Set Start en end for selection If Left(objRange.Text, 3) = "1.2" Then Set TStart = objRange.Range If Left(objRange.Text, 3) = "1.3" Then Set TEnd = objRange.Range End Select Next WDoc.Range(TStart.Start, TEnd.End).Select MsgBox "Done" Set WDoc = Nothing End Sub |
Tags |
chapters, selecting text |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Mike84bs | Word | 2 | 07-25-2016 07:36 AM |
How to number chapters and sub-chapters in a few clicks? | Icelandic_Boy | Word | 1 | 05-24-2016 11:33 AM |
VBA Search Table for Text/Select Text/Insert Hyperlink | sldrellich | Word VBA | 3 | 03-24-2015 01:09 PM |
Microsoft Word macro to find text, select all text between brackets, and delete | helal1990 | Word VBA | 4 | 02-05-2015 03:52 PM |
![]() |
newbieX | Word VBA | 3 | 03-28-2014 04:21 PM |