Re: [問題]關於合併列印的儲存

看板Trace (軟體操作討論)作者 (Abruti)時間19年前 (2006/02/02 23:44), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
參考 WD2002: How to Programmatically Save Each Page or Section of a Document As Separate File http://support.microsoft.com/kb/306348/EN-US/ 首先你需要建立一個新的巨集,然後將虛線部分取代為他的程式碼 ---------------------------------------------------------------------------- Sub BreakOnPage() ' Used to set criteria for moving through the document by page. Application.Browser.Target = wdBrowsePage For i = 1 To ActiveDocument.BuiltInDocumentProperties("Number of Pages") 'Select and copy the text to the clipboard. ActiveDocument.Bookmarks("\page").Range.Copy ' Open new document to paste the content of the clipboard into. Documents.Add Selection.Paste ' Removes the break that is copied at the end of the page, if any. Selection.TypeBackspace ChangeFileOpenDirectory "C:\" DocNum = DocNum + 1 ActiveDocument.SaveAs FileName:="test_" & DocNum & ".doc" ActiveDocument.Close ' Move the selection to the next page in the document. Application.Browser.Next Next i ActiveDocument.Close savechanges:=wdDoNotSaveChanges End Sub ---------------------------------------------------------------------------- 完成之後,每次你要另存的新文件就使用BreakonPage這個巨集執行, 變成自動幫你存成檔案。 ps.她預設的儲存位置是c:\,名稱為test_<頁碼>.doc ※ 引述《bearsi (bearsi)》之銘言: : 請問大家 : 當合併列印後得到大量的新文件 : 有沒有可能可以將這些新文件分開儲存? : 舉例來說 : 當我合併列印後 : 得到了具有十筆資料的新文件 : 但是能不能夠另存為十個檔案呢? : 這個問題我查了很久 : 沒看過有相關的討論 : 希望有人可以提供意見 : 謝謝 -- who make my blue eyes blue... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.244.51.74

02/03 01:08, , 1F
多謝,還以為這題無解了
02/03 01:08, 1F
文章代碼(AID): #13uYZj0y (Trace)
文章代碼(AID): #13uYZj0y (Trace)