当前在线人数18070
首页 - 分类讨论区 - 电脑网络 - 葵花宝典版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:Re: [转载] Please Help on word 2000 with VBA !
[同主题阅读] [版面: 葵花宝典] [作者:jokee] , 2004年07月26日15:02:25
jokee
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: jokee (jokee), 信区: Programming
标  题: Re: [转载] Please Help on word 2000 with VBA !
发信站: Unknown Space - 未名空间 (Mon Jul 26 15:07:15 2004), 转信

Sub SeparatePagesFromDocument()
Dim rng As Range
Dim i As Integer
Dim oDoc As Document, nDoc As Document
Set oDoc = ActiveDocument
For i = 1 To oDoc.BuiltInDocumentProperties(wdPropertyPages)
  Set rng = oDoc.GoTo(what:=wdGoToPage, which:=wdGoToAbsolute, Count:=i)
  rng.Select
  Set rng = Selection.Bookmarks("\page").Range
  rng.Select
  rng.Copy
  Set nDoc = Documents.Add
  nDoc.Range.PasteSpecial
  nDoc.SaveAs "C:\temp\" & Replace(oDoc.Name, ".doc", "") & "-Part-" & i
  nDoc.Close
Next i
Set rng = Nothing
Set nDoc = Nothing
Set oDoc = Nothing
End Sub

【 在 leau (有官兵) 的大作中提到: 】
: 【 以下文字转载自 Windows 讨论区,原文如下 】
: 发信人: leau (有官兵), 信区: Windows
: 标  题: Please Help on word 2000 with VBA !
: 发信站: Unknown Space - 未名空间 (Mon Jul 26 11:41:16 2004) WWW-POST
: Hi, guys,
: Does anyone can give me a clue of the following project.  Thousands of thanks
: in advance!
: Everyday I have to generate a big word 2000 document which has about 100
: pages.  My boss wants it to be broken into 2 pages each and saved each
: as a specific "[cust-name] welcome packet.doc " in a folder.
: I think the VBA can do it but I don't know how.  Please any exper can have any
: idea??? 
: Waiting on line!!!


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 68.237.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996