Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2015, 11:31 AM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default Splitting Word Document based on line content

We have this working document that is curated by individual parties on both sides of an ocean. In the document is daily information on projects, news, etc and pertains to individual staff members on either side. This makes it nearly impossible to make it easy to read for any one person. I've tried my best to get everyone to move to basically *anything* else, but stubborn...



So the document is laid out like:

Topic / Person / Engineer
Content
Content
Content
<space>
Topic / Person / Engineer
<repeat above>

What I'd like to do is read line by line selecting, cutting and pasting into individual new documents based on "Person". I've run into nothing but problems. I am looping line by line using Selection.MoveDown and I am able to properly select a section, but when I need to check the current position for the next "title" marker I lose my selection.

Frustrating.

There's gotta be a simple way to do this. Any suggestions where to start?

Notes:
Doc could be 10-50 pages long
Content could be any number of things (multiple lines, paragraphs, tables)
I could put in some sort of actual delimiters. Currently there are Horizontal Lines between each section.

I hate this document...
Reply With Quote
  #2  
Old 10-05-2015, 06:57 PM
macropod's Avatar
macropod macropod is offline Splitting Word Document based on line content Windows 7 64bit Splitting Word Document based on line content Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Does the document have a proper structure, for example, the use of Heading Styles for Topic / Person / Engineer and one or more different Styles for the remainder? If not, how is a macro supposed to recognise when Topic / Person / Engineer occurs, other than by a preceding <space> (by which I guess you mean an empty paragraph and never via paragraph formatting), especially if there's the potential for such spaces to occur elsewhere?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-06-2015, 06:39 AM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Does the document have a proper structure, for example, the use of Heading Styles for Topic / Person / Engineer and one or more different Styles for the remainder? If not, how is a macro supposed to recognise when Topic / Person / Engineer occurs, other than by a preceding <space> (by which I guess you mean an empty paragraph and never via paragraph formatting), especially if there's the potential for such spaces to occur elsewhere?
Of course not, that would be too easy... I've fought this document for years and I just can't get away from it.

I can add some type of delimiter if that would help.
Reply With Quote
  #4  
Old 10-06-2015, 06:53 AM
macropod's Avatar
macropod macropod is offline Splitting Word Document based on line content Windows 7 64bit Splitting Word Document based on line content Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Splitting a document via macro requires a consistent pattern in the content that can be used to locate the range spanned by each portion. For example, you refer to them starting with a 'Topic / Person / Engineer' heading. Is that the literal text, or just a description? If it's a description, is there a pattern or even a format that one could rely on to differentiate these headings from everything else?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-06-2015, 07:36 AM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Splitting a document via macro requires a consistent pattern in the content that can be used to locate the range spanned by each portion. For example, you refer to them starting with a 'Topic / Person / Engineer' heading. Is that the literal text, or just a description? If it's a description, is there a pattern or even a format that one could rely on to differentiate these headings from everything else?
That's just how it is now, there certainly could be Here's an example heading:

4437R Sourcing Issue / Karen / Lisa / Jim

Topic / SalesPerson / Account Manager / Engineer

I thought about adding markers for delimiters "***4437R Sourcing Issue / Karen / Lisa / Jim"
Reply With Quote
  #6  
Old 10-06-2015, 07:47 AM
macropod's Avatar
macropod macropod is offline Splitting Word Document based on line content Windows 7 64bit Splitting Word Document based on line content Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, so does every heading contain three forward slashes (i.e. /)? Do the Topics always begin with a number?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 10-06-2015, 07:53 AM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
OK, so does every heading contain three forward slashes (i.e. /)? Do the Topics always begin with a number?
Not every heading currently contains 3 slashes, but I can make that a requirement of the editors of the document. NO, topics can be anything and do not solely start with numbers.
Reply With Quote
  #8  
Old 10-06-2015, 12:57 PM
macropod's Avatar
macropod macropod is offline Splitting Word Document based on line content Windows 7 64bit Splitting Word Document based on line content Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Does every heading contain a single forward slash (i.e. /) before 'person'?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 10-06-2015, 02:07 PM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Does every heading contain a single forward slash (i.e. /) before 'person'?
It certainly can. For the most part, does now. But it should be noted that there could be forward slashes elsewhere in the document besides the title. I'm open to some other less used delimiter or coded delimiter of some type.
Reply With Quote
  #10  
Old 10-06-2015, 02:18 PM
macropod's Avatar
macropod macropod is offline Splitting Word Document based on line content Windows 7 64bit Splitting Word Document based on line content Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What I am trying to establish is whether there is a useable pattern that can be used to automate the process in some way. All your replies suggest not, in which case you may as well stick with laboriously copying & pasting content to new documents. Going through a document adding delimiters, etc. so that an automated process could be developed and applied would probably take about as long, overall.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 10-06-2015, 02:30 PM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
What I am trying to establish is whether there is a useable pattern that can be used to automate the process in some way. All your replies suggest not, in which case you may as well stick with laboriously copying & pasting content to new documents. Going through a document adding delimiters, etc. so that an automated process could be developed and applied would probably take about as long, overall.
But this is a daily task... So if we start putting the delimiters needed in place now, in the future we can run a macro against it.

We use and update this document daily.
Reply With Quote
  #12  
Old 10-06-2015, 02:38 PM
macropod's Avatar
macropod macropod is offline Splitting Word Document based on line content Windows 7 64bit Splitting Word Document based on line content Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So why not start with a new document for each day? Your current process seems to be making a rod for your own backs, so to speak. In any event, if you're only splitting out a day's content at a time to a single document, you hardly need a macro for that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #13  
Old 10-06-2015, 02:52 PM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
So why not start with a new document for each day? Your current process seems to be making a rod for your own backs, so to speak. In any event, if you're only splitting out a day's content at a time to a single document, you hardly need a macro for that.
Sorry, I may not be clearly identifying how this document works for us.

We create a topic:

12345 Sourcing Issue Bob / Karen / Rich
10/6 Karen: You guys failed to source the materials for this PN
10/6 (Factory Person): Oh sorry about that, you know how it is
10/7 Bob: Yeah, blah blah blah you guys do this to us all the time
10/9 (Factory Person): OK we finally got the materials, now what?

55432 Part Burned Down Customer Location! Julie / Mike / Steve
10/1 Julie: Just heard that this part caused a fire at a customer location
10/2 (Factory): That sucks, you know Chinese parts!
10/3 Julie: No seriously, WTF Batman.

Replies are made to topics on a daily basis. This document can have months of conversations spanning 10-30 pages. Every day we make our replies, send it over to factory. Their day (our night) they make their replies and send back. We continue working off the same document every day.

I just want to bust everything out by one of the names in the title. So all topics with Bob end up in a "BOB.DOC" and all with Julie end up in "Julie.DOC"

Trust me I can't stand this thing. But China can be frustratingly bad to work with. I actually wanted to turn the whole thing into a user forum, but the cry babies on both sides of the ocean are whining about it already. Some people can't take change.
Reply With Quote
  #14  
Old 10-06-2015, 06:58 PM
macropod's Avatar
macropod macropod is offline Splitting Word Document based on line content Windows 7 64bit Splitting Word Document based on line content Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So how would those two examples look when exported, and how many files would they produce?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #15  
Old 10-07-2015, 06:43 AM
TwiceOver TwiceOver is offline Splitting Word Document based on line content Windows 8 Splitting Word Document based on line content Office 2010 32bit
Novice
Splitting Word Document based on line content
 
Join Date: Oct 2015
Posts: 12
TwiceOver is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
So how would those two examples look when exported, and how many files would they produce?
So I'll add some more context to the above:

12345 Sourcing Issue Bob / Karen / Rich
10/6 Karen: You guys failed to source the materials for this PN
10/6 (Factory Person): Oh sorry about that, you know how it is
10/7 Bob: Yeah, blah blah blah you guys do this to us all the time
10/9 (Factory Person): OK we finally got the materials, now what?

55432 Part Burned Down Customer Location! Julie / Mike / Steve
10/1 Julie: Just heard that this part caused a fire at a customer location
10/2 (Factory): That sucks, you know Chinese parts!
10/3 Julie: No seriously, WTF Batman.

XYZ Company Needs New Label Bob / Carl / Susan
9/29 Bob: Company requests their zip code on box label
9/30 (Factory): That's crazy, who needs a zip code on a label
10/1 Bob: It's what the customer wants, do it
10/2 (Factory): OK. If we have to

So in the above 3 post examples I would want them to split out into documents based on the "SalesPerson" label (the first name in the 3-name splits). So in the three above examples there are only 2 sales person topics Bob and Julie so...

BOB.DOCX
12345 Sourcing Issue Bob / Karen / Rich
10/6 Karen: You guys failed to source the materials for this PN
10/6 (Factory Person): Oh sorry about that, you know how it is
10/7 Bob: Yeah, blah blah blah you guys do this to us all the time
10/9 (Factory Person): OK we finally got the materials, now what?

XYZ Company Needs New Label Bob / Carl / Susan
9/29 Bob: Company requests their zip code on box label
9/30 (Factory): That's crazy, who needs a zip code on a label
10/1 Bob: It's what the customer wants, do it
10/2 (Factory): OK. If we have to

JULIE.DOCX
55432 Part Burned Down Customer Location! Julie / Mike / Steve
10/1 Julie: Just heard that this part caused a fire at a customer location
10/2 (Factory): That sucks, you know Chinese parts!
10/3 Julie: No seriously, WTF Batman.


Now there could be 10,20,30,100 topics per sales person spanning several pages. In general we have about 5 sales people to do split this document into.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting Word Document based on line content split word document based on bookmarks with each new document title of the bookmark megatronixs Word VBA 9 09-05-2020 02:29 PM
More than one content controls in a word document lucky16 Word VBA 6 07-10-2014 08:34 AM
Document splitting MsLavigne Word 2 05-09-2012 05:52 AM
Splitting Word Document based on line content WORD 2003 Need help splitting a HUGE Document dlawson Word 4 04-14-2009 12:22 PM
How to add Table of Content in word document by C# ! ! ! arun singh Word 0 11-12-2008 11:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:02 AM.


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