Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-01-2016, 07:34 AM
uday.word uday.word is offline VBA to split word document containing pictures using delimter Windows 7 32bit VBA to split word document containing pictures using delimter Office 2013
Novice
VBA to split word document containing pictures using delimter
 
Join Date: Sep 2016
Posts: 2
uday.word is on a distinguished road
Default VBA to split word document containing pictures using delimter

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!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to split word document containing pictures using delimter Word VBA - Split Document By Headings - Save File Name As Heading Name jc491 Word VBA 7 01-21-2022 11:04 AM
VBA to split word document containing pictures using delimter split word document based on bookmarks with each new document title of the bookmark 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
VBA to split word document containing pictures using delimter How do I see one document map for each half of a split MS WORD 2010 document? quickwin Word 3 07-09-2013 10:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft