![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#5
|
|||
|
|||
|
Actually you weren't doing anything right.
Code:
Sub SplitDocumentTest()
Dim oRng As Range
Dim oDoc As Document
Set oRng = ActiveDocument.Range
With oRng
.Collapse wdCollapseStart
.EndOf Unit:=wdSection, Extend:=wdExtend
.MoveEnd wdCharacter, -1
Set oDoc = Documents.Add()
.Copy
oDoc.Content.Paste
oDoc.SaveAs2 FileName:="Specification_1", FileFormat:=wdFormatXMLDocument
Set oDoc = Nothing
.Collapse wdCollapseEnd
.MoveStart wdCharacter, 1
.EndOf Unit:=wdSection, Extend:=wdExtend
.MoveEnd wdCharacter, -1
Set oDoc = Documents.Add()
.Copy
oDoc.Content.Paste
oDoc.SaveAs2 FileName:="Specification_2", FileFormat:=wdFormatXMLDocument
Set oDoc = Nothing
.Collapse wdCollapseEnd
.MoveStart wdCharacter, 1
.EndOf Unit:=wdSection, Extend:=wdExtend
.MoveEnd wdCharacter, -1
Set oDoc = Documents.Add()
.Copy
oDoc.Content.Paste
oDoc.SaveAs2 FileName:="Specification_3", FileFormat:=wdFormatXMLDocument
Set oDoc = Nothing
End With
lbl_Exit:
Exit Sub
End Sub
|
| Tags |
| resources, select text |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Searching in main body document and text boxes at the same time | laith93 | Word VBA | 0 | 10-31-2021 10:38 AM |
| Searching for e-mails in a Shared Mailbox prior to start date. | m5fgn | Outlook | 4 | 08-08-2019 03:43 AM |
Change Drawing Tools to Text Box Tools to insert address in labels
|
Alecf | Drawing and Graphics | 5 | 09-01-2017 05:27 AM |
| Start and stop an executeble from vba | remmyMartin | Outlook | 0 | 01-12-2012 08:09 AM |
Remove text in start up document
|
Sheila | Word | 1 | 09-30-2010 03:33 PM |