- 帖子
- 47
- 主題
- 19
- 精華
- 0
- 積分
- 82
- 點名
- 0
- 作業系統
- win
- 軟體版本
- xp
- 閱讀權限
- 20
- 註冊時間
- 2014-7-4
- 最後登錄
- 2021-9-4
|
本帖最後由 ciboybj 於 2021-9-1 22:41 編輯
以下是我直覺想到的方式
看有沒有版上的大神有其他的更好的方式
如果要把一個檔案拆成6個,應該是利用剪下、刪除等方式可以簡單達到- Sub test()
- '到指定頁數,設定書籤
- Selection.GoTo wdGoToPage, wdGoToAbsolute, 1
- ActiveDocument.Bookmarks.Add name:="p1"
- Selection.GoTo wdGoToPage, wdGoToAbsolute, 90
- ActiveDocument.Bookmarks.Add name:="p90"
-
- '利用書籤,設定範圍、選取範圍、複製範圍內容
- Dim orng As Range
- Set orng = ActiveDocument.Range
- orng.Start = orng.Bookmarks("p1").Range.End
- orng.End = orng.Bookmarks("p90").Range.Start
- orng.Select
- orng.Copy
-
- '建立新檔案,將複製的範圍內容貼入至新檔案中,新檔案另存指定名稱
- Dim docNew As Document
- Set docNew = Documents.Add
- With docNew
- .Content.Paste
- .SaveAs FileName:="Sample.doc"
- End With
- End Sub
複製代碼 |
|