Home > Software engineering >  A key to VBA ~ word split PDF for help
A key to VBA ~ word split PDF for help

Time:10-16

Bosses to see, this is can realize the doc file, automatically split into five PDF file, but now want to split into five doc file, just change the PDF to doc, compilation is normal, but stil doc file, turn to for help ~

CodePudding user response:

 Sub demo () 
Dim I As Object, the name As a String, the path As String
Path=ActiveDocument. Path & amp; ""
For Each I In ActiveDocument. Sections
The Select Case i.I ndex
Case 1
Name="04 illustrate the book. Doc"
Case 2
Name="03 the appended drawings. Doc"
Case 3
Name="01 patent claim. Doc"
Case 4
Name="02 instruction. Doc"
Case 5
Name="05 instruction attached figure. Doc"
In Case the Else
The Exit For
End the Select
I.R ange. Copy
The Documents. The Add
Selection. Paste
ActiveDocument. SaveAs FileName:=path & amp; The name, FileFormat:=0
ActiveDocument. Close True
Next I
End Sub
  •  Tags:  
  • VBA
  • Related