Skip to main content

Conas doiciméad a roinnt ina iliomad doiciméad i bhfocal?

Má tá doiciméad ollmhór focal agat a chaithfidh tú a roinnt ina iliomad doiciméad, glac cúpla nóiméad chun an rang teagaisc seo a léamh. Taispeánfaidh an rang teagaisc seo dhá mhodh duit chun doiciméad a roinnt ina iliomad doiciméad.


Scoilt doiciméad Word de réir teorantóra sonraithe le VBA

In ionad doiciméad a roinnt ina iliomad doiciméad de láimh, tabharfaidh an modh seo VBA isteach chun doiciméad Word a roinnt ar an teimpléad sonraithe i Word. Déan mar a leanas le do thoil:

1. Brúigh Alt + F11 eochracha le chéile chun an fhuinneog Microsoft Visual Basic for Application a oscailt;

2. Cliceáil Ionsáigh > Modúil, agus ansin greamaigh faoi bhun chód VBA isteach i bhfuinneog nua an Mhodúil oscailte.

VBA: Roinn Doiciméad Focal i nDoiciméid Il le Delimiter

Sub SplitNotes(delim As String, strFilename As String)
Dim doc As Document
Dim arrNotes
Dim I As Long
Dim X As Long
Dim Response As Integer
arrNotes = Split(ActiveDocument.Range, delim)
Response = MsgBox("This will split the document into " & UBound(arrNotes) + 1 & " sections.Do you wish to proceed?", 4)
If Response = 7 Then Exit Sub
For I = LBound(arrNotes) To UBound(arrNotes)
If Trim(arrNotes(I)) <> "" Then
X = X + 1
Set doc = Documents.Add
doc.Range = arrNotes(I)
doc.SaveAs ThisDocument.Path & "\" & strFilename & Format(X, "000")
doc.Close True
End If
Next I
End Sub
Sub test()
'delimiter & filename
SplitNotes "///", "Notes "
End Sub

3. Ansin cliceáil Rith cnaipe nó brúigh eochair F5 chun an VBA a chur i bhfeidhm.

4. Sa doiciméad Microsoft Word a phiocadh amach, cliceáil le do thoil an cnaipe Sea chun dul ar aghaidh.

Nóta:
(1) Bí cinnte go gcuirfidh tú do theorannóir mar an gcéanna le "///" san fho-thástáil a ghabhann leis an doiciméad idir gach cuid den téacs is mian leat a dheighilt. Chomh maith leis sin, is féidir leat athrú "///" le haon teorantóirí chun freastal ar do riachtanas.
(2) Féadfaidh tú na doiciméid a athrú "Nótaí" san fho-Tástáil a oireann do do riachtanais.
(3) Agus sábhálfar na doiciméid scoilteadh go dtí an áit chéanna leis an gcomhad bunaidh.
(4) Ní gá duit teorantóir a chur le deireadh an chomhaid bhunaidh, má dhéanann tú, beidh doiciméad bán ann tar éis a scoilteadh.

Scoilt doiciméad Word de réir leathanaigh le VBA

Seo VBA eile chun cabhrú leat doiciméad Word amháin a roinnt go iolrach de réir leathanaigh i Word. Déan mar a leanas le do thoil:

1. Brúigh Alt + F11 eochracha le chéile chun an fhuinneog Microsoft Visual Basic for Application a oscailt;

2. Cliceáil Ionsáigh > Modúil, agus ansin greamaigh faoi bhun chód VBA isteach i bhfuinneog nua an Mhodúil oscailte.

VBA: Roinn Doiciméad ina Ildhoiciméid de réir Leathanach i Word

Sub SplitIntoPages()
Dim docMultiple As Document
Dim docSingle As Document
Dim rngPage As Range
Dim iCurrentPage As Integer
Dim iPageCount As Integer
Dim strNewFileName As String
Application.ScreenUpdating = False 'Makes the code run faster and reduces screen _
flicker a bit.
Set docMultiple = ActiveDocument 'Work on the active document _
(the one currently containing the Selection)
Set rngPage = docMultiple.Range 'instantiate the range object
iCurrentPage = 1
'get the document's page count
iPageCount = docMultiple.Content.ComputeStatistics(wdStatisticPages)
Do Until iCurrentPage > iPageCount
If iCurrentPage = iPageCount Then
rngPage.End = ActiveDocument.Range.End 'last page (there won't be a next page)
Else
'Find the beginning of the next page
'Must use the Selection object. The Range.Goto method will not work on a page
Selection.GoTo wdGoToPage, wdGoToAbsolute, iCurrentPage + 1
'Set the end of the range to the point between the pages
rngPage.End = Selection.Start
End If
rngPage.Copy 'copy the page into the Windows clipboard
Set docSingle = Documents.Add 'create a new document
docSingle.Range.Paste 'paste the clipboard contents to the new document
'remove any manual page break to prevent a second blank
docSingle.Range.Find.Execute Findtext:="^m", ReplaceWith:=""
'build a new sequentially-numbered file name based on the original multi-paged file name and path
strNewFileName = Replace(docMultiple.FullName, ".doc", "_" & Right$("000" & iCurrentPage, 4) & ".doc")
docSingle.SaveAs strNewFileName 'save the new single-paged document
iCurrentPage = iCurrentPage + 1 'move to the next page
docSingle.Close 'close the new document
rngPage.Collapse wdCollapseEnd 'go to the next page
Loop 'go to the top of the do loop
Application.ScreenUpdating = True 'restore the screen updating
'Destroy the objects.
Set docMultiple = Nothing
Set docSingle = Nothing
Set rngPage = Nothing
End Sub 

3. Ansin cliceáil Rith cnaipe nó brúigh F5 eochair chun an VBA a chur i bhfeidhm.

Nóta: Sábhálfar na doiciméid scoilteadh san áit chéanna leis an gcomhad bunaidh.


Roinn cáipéis Word de réir ceannteidil / briseadh leathanaigh / rannóige / briseadh leathanaigh le Kutools a úsáid le haghaidh Word

Má tá Kutools for Word suiteáilte agat, is féidir leat a chuid a chur i bhfeidhm Scoilt feidhm chun doiciméad amháin a roinnt go héasca i ndoiciméid iolracha de réir leathanaigh, ceannteidil, briseadh ailt, nó briseadh leathanaigh de réir mar a theastaíonn uait i Word.

Kutools le haghaidh Word an breiseán Word deiridh a dhéanann do chuid oibre a chuíchóiriú agus a threisíonn do scileanna próiseála doiciméad. Bain triail as SAOR IN AISCE do 60 laethanta! Faigh é anois!

1. Cliceáil Kutools Plus > Scoilt chun a chumasú Scoilt gné.

2. Sa dialóg Scoilt tosaigh ar an scáileán, is féidir leat é seo a leanas a dhéanamh:

(1) Roghnaigh an bealach scoilte ón Scoilt ag liosta anuas.
Tacaíonn an ghné seo le 6 bhealach scoilte: ceannteideal 1, sosanna leathanaigh, briseadh rannáin, leathanaigh, gach n leathanach, agus raonta saincheaptha leathanaigh mar atá thíos an pictiúr a thaispeántar:

(2) Cliceáil ar an Brabhsáil cnaipe  a shonrú sábhálfaidh tú na cáipéisí roinnte san fhillteán ceann scríbe;

(3) Clóscríobh eochairfhocal mar réimír ainmneacha doiciméad nua sa Réimír Doiciméid bosca.

Leid:
(1) Má shonraíonn tú an scoilt déan an doiciméad reatha le Gach n leathanaigh, ní mór duit an uimhir sa Gach n leathanaigh bosca;

(2) Má shonraíonn tú an doiciméad reatha a roinnt de réir raonta leathanaigh saincheaptha, ní mór duit na raonta leathanaigh saincheaptha seo a iontráil scartha le camóga sa Leathanach bosca, mar shampla, cineál 1, 3-5, 12 sa bhosca.

3. Cliceáil ar an Ok cnaipe chun scoilteadh a thosú.

Ansin roinntear an doiciméad reatha ar an mbealach scoilte sonraithe, agus sábhálfar cáipéisí nua san fhillteán ceann scríbe ar an mórchóir.

Brabhsáil agus eagarthóireacht tabbed ar dhoiciméid iomadúla Word mar Firefox, Chrome, Internet Explore 10!

B’fhéidir go mbeadh cur amach agat ar leathanaigh ghréasáin iomadúla i Firefox / Chrome / IE, agus aistriú eatarthu trí chluaisíní comhfhreagracha a chliceáil go héasca. Anseo, tacaíonn Office Tab le próiseáil den chineál céanna, a ligeann duit brabhsáil a dhéanamh ar iliomad doiciméad Word i bhfuinneog Word amháin, agus aistriú eatarthu go héasca trí chliceáil ar a gcuid cluaisíní. Cliceáil le haghaidh triail iomlán gnéithe saor in aisce!
Brabhsáil cáipéisí ilfhocail i bhfuinneog amháin mar Firefox


Earraí coibhneasta:


Uirlisí Táirgiúlachta Oifige is Fearr

Kutools le haghaidh Word - Elevate Your Word Experience with Over 100 Gnéithe Suntasacha!

🤖 Cúntóir Kutools AI: athraigh do chuid scríbhinn le AI - Gin Ábhar  /  Athscríobh Téacs  /  Déan achoimre ar Dhoiciméid  /  Fiosraigh le haghaidh Faisnéise bunaithe ar Doiciméad, ar fad laistigh de Word

📘 Máistreacht Doiciméad: Leathanaigh Scoilte  /  Cumaisc Doiciméid  /  Roghnú Easpórtála i bhFormáidí Éagsúla (PDF/TXT/DOC/HTML...)  /  Baisc a thiontú go PDF  /  Easpórtáil Leathanaigh mar Íomhánna  /  Priontáil Comhaid Il ag an am céanna...

Eagarthóireacht na nÁbhar: Faigh Baisc agus Ionadaigh thar Chomhaid Il  /  Athraigh Méid Gach Pictiúr  /  Trasnaigh Rónna Tábla agus Colúin  /  Tiontaigh Tábla go Téacs...

🧹 Effortless Glan: Sguab as Spásanna Breise  /  Sosanna Alt  /  Gach Ceanntásca  /  Boscaí Téacs  /  Hipearnasc  / Le haghaidh tuilleadh uirlisí a bhaint, ceann chuig ár Bain Grúpa...

Ionsáigh Cruthaitheach: cuir isteach Míle Deighilteoir  /  Boscaí Seiceála  /  Cnaipí Raidió  /  Cód QR  /  barcode  /  Tábla Líne Trasnánach  /  Fotheideal Cothromóid  /  Fotheideal Íomhá  /  Fotheideal Tábla  /  Pictiúir Il  / Faigh amach níos mó sa Cuir isteach Grúpa...

🔍 Roghanna Beachtais: Pionta leathanaigh ar leith  /  táblaí  /  cruthanna  /  míreanna ceannteideal  / Feabhsaigh an loingseoireacht le níos mó Roghnaigh gnéithe...

Feabhsuithe Réalta: Déan nascleanúint go tapa chuig aon láthair  /  cuir isteach téacs athchleachtach go huathoibríoch  /  scoránaigh gan uaim idir fuinneoga doiciméad  /  11 Uirlisí Tiontaithe...

???? Ar mhaith leat triail a bhaint as na gnéithe seo? Kutools le haghaidh Word cuireann a Triail saor in aisce 60 lá, gan teorainneacha! 🚀
 
Comments (45)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
VBA: Split Document into Multiple Documents by Page in Word - in this when we run it, outcome comes in portrait layout only. If original doc is in landscape then full data of the original doc does not come in the pages breaked by this vba.. There must be seperate vba for portrait and landscape docs.
This comment was minimized by the moderator on the site
I use the "split"-function of "Kutools For Word 9.00" with "header 1" and it works for 48 documents and then it simply stops without any message, as if it wohl have been finished. But I have 700 "header 1" in a 2000 pages document!
Is it simply too much for the tool or is there any other reason?
This comment was minimized by the moderator on the site
your code add new blank page in every page
This comment was minimized by the moderator on the site
This worked fine up until yesterday with Office365, but now I constantly get a runtime error '4605' stating this command is not available. Sometimes at the first page, sometimes at the 3rd page...I can't make it past 3 pages anymore. It happens with line 28 above...

docSingle.Range.Paste 'paste the clipboard contents to the new document
This comment was minimized by the moderator on the site
I've got this error too - Did you get anywhere with it?


Thanks
This comment was minimized by the moderator on the site
yes...i have to run it on the local hard drive. if i run it on a network file or with RemotePC it. has something to do with the script having to wait too long in between commands and it errors out copy and pasting to the clipboard. hope that helps!!
This comment was minimized by the moderator on the site
I copied the document distribution macro 'Split Word Document By Specified Delimiter With VBA', but in the line of 'sub test', the software reads it as a new macro and there are two macros here.
This comment was minimized by the moderator on the site
The script saves a two pages document, the second is total blank.

How to solve this?
This comment was minimized by the moderator on the site
Hi Jorge,
The VBA script introduced splits document by the separator “///”, and you do not need to add delimiter to the end of the original file, if you do, there will be a blank document after splitting.
This comment was minimized by the moderator on the site
Hi kellytte, Could you please explain a little further? I copy and paste the VBA script under the "Split Word by Document with VBA" from above and after I run the process following the instructions above, I always have to manually delete a 2nd blank page on each of the new documents that were created. Are you saying there is something that needs to be removed from the VBA script that will cause this to stop?
This comment was minimized by the moderator on the site
The split works great for me but on page in the merge file turns into 1.5 pages - something with the page layout (+ additional empty page at the end). any ideas how to go around that?
This comment was minimized by the moderator on the site
The Split Word By Document with VBA worked for me, but it is adding a blank page at the end of each document. Is there a way around this?
This comment was minimized by the moderator on the site
I am working on this as well but have not found a way to do it besides manually.
This comment was minimized by the moderator on the site
Does not work at all for me. Goes through the motions but no documents are saved. Maybe because I am using .DOCX files?
This comment was minimized by the moderator on the site
After playing with this code for over an hour I discovered you have to save the document you mail merged then you can run the code on the saved document that has all the pages you need to split up. Hope this helps.
This comment was minimized by the moderator on the site
I always start with a newly-saved document. I found the split documents were actually saved somewhere (I forget; doesn't matter) they were text only - all the formatting had been dropped.
This comment was minimized by the moderator on the site
Maybe something to do with Windows 7 settings? Thoughts from anyone?
This comment was minimized by the moderator on the site
Mais comment garder une mise en page complexe (image de fond, marges, etc) ?
Great but how to keep the lay-out (background image, margins ?)
This comment was minimized by the moderator on the site
Can you split the document based on Heading 1 styles as your "delimiter".
This comment was minimized by the moderator on the site
Hi Andrew,
The VBA script can split the entire document by page. If you need to split by heading 1, we suggest to try Kutools for Word’s Split (Document) feature.
This comment was minimized by the moderator on the site
Downloaded fodler doesnt open at all. Waiting for a long time.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations