A macro to divide one Word doc into smaller docs of 5 pages each
Autor de la hebra: Smith Park
Smith Park
Smith Park  Identity Verified
República de Corea (Corea del Sur)
Local time: 17:10
Miembro 2005
inglés al coreano
Dec 25, 2002

This macro divides the .doc into several small .docs.

Each of them is consist of five pages of the original .doc.



made by [email protected]







Sub MyPages()

Dim i, n, TotalPages As Integer

Dim fname As String

TotalPages = Selection.Information(wdNumberOfPagesInDocument)

n = 1

For i = 1 To (TotalPages / 5)

... See more
This macro divides the .doc into several small .docs.

Each of them is consist of five pages of the original .doc.



made by [email protected]







Sub MyPages()

Dim i, n, TotalPages As Integer

Dim fname As String

TotalPages = Selection.Information(wdNumberOfPagesInDocument)

n = 1

For i = 1 To (TotalPages / 5)



Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=6, Name:=\"\"

Selection.Find.ClearFormatting

With Selection.Find

.Text = \"\"

.Replacement.Text = \"\"

.Forward = True

.Wrap = wdFindContinue

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchByte = False

.CorrectHangulEndings = True

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.HomeKey Unit:=wdStory, Extend:=wdExtend

Selection.Cut

Documents.Add

Selection.Paste

fname = Str(n) + \"-\" + Str(n + 4)

ActiveDocument.SaveAs filename:=fname, _

FileFormat:=wdFormatDocument, LockComments:=False, Password:=\"\", _

AddToRecentFiles:=False, WritePassword:=\"\", ReadOnlyRecommended:=False, _

EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _

:=False, SaveAsAOCELetter:=False

ActiveDocument.Close

n = n + 5

Next i

End Sub



[Edited at 2005-12-03 04:16]
Collapse


 
Michael Bastin
Michael Bastin  Identity Verified
España
Local time: 10:10
inglés al francés
+ ...
great Dec 26, 2002

Hi,



This Macro is really helpful, certainly for large files you have to split between translators.



However, I have a newbie question... How/where do you create this macro.



I go in Word > Tools > Macro and then I am a bit lost as to what to choose. Visual Basic or Microsoft editor.



Any help to use this macro would be welcome.



Thank you


 
Smith Park
Smith Park  Identity Verified
República de Corea (Corea del Sur)
Local time: 17:10
Miembro 2005
inglés al coreano
PERSONA QUE INICIÓ LA HEBRA
Dec 30, 2002



[Edited at 2004-05-18 00:13]


 
Smith Park
Smith Park  Identity Verified
República de Corea (Corea del Sur)
Local time: 17:10
Miembro 2005
inglés al coreano
PERSONA QUE INICIÓ LA HEBRA
Thank you! Dec 30, 2002

In Word, press Alt + F11, the Visual Basic Editor will open.

Good luck and have fun with it!

Thank you again.

yhpark.


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

A macro to divide one Word doc into smaller docs of 5 pages each






Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »