![]() |
#1
|
|||
|
|||
![]()
I have been using the below code to split word documents to multiple sub documents with the help of delimiter. Now my word file contains pictures inserted between the text and this macro is not able to read them. This macro simply splits the text only.
Can any one please help me on this?? I need the macro to work on pictures as well and gets split accordingly. Option Explicit 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 Any solution on this helpful. Many thanks! |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jc491 | Word VBA | 7 | 01-21-2022 11:04 AM |
![]() |
megatronixs | Word VBA | 9 | 09-05-2020 02:29 PM |
Split one Word Document into Multiple PDFs | VieraOfficeUser | Word | 3 | 07-30-2014 10:58 PM |
Split a word document | officeboy09 | Word VBA | 6 | 04-12-2014 05:07 AM |
![]() |
quickwin | Word | 3 | 07-09-2013 10:20 PM |