Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2019, 02:09 PM
Chayes Chayes is offline reassemble fractured text Windows 7 32bit reassemble fractured text Office 2003
Advanced Beginner
reassemble fractured text
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default reassemble fractured text

I've been trying to reassemble as best I can some text passages which have been broken in email transport. I'd like to run a vba code to do this , based on how many words appear in each line. So for example , if the line has just three words , it would bring up the line below until a certain number of words was present in each line.


As an example ;




-------------------------------------------------------------
"Your Privacy
and Data

We only collect
data from
you sufficient to
process and deliver
your order.
We don’t use
your data for any
other purpose
than this. "


-------------------------------------------------------------
Would become :


-------------------------------------------------------------
"Your Privacy and Data

We only collect data from you sufficient to process and deliver your order. We don’t use your data for any other purpose than this."



-------------------------------------------------------------


I do appreciate this would be an imperfect process with certain imponderables , but would like to get close to the original as possible.


I'd be grateful for any assistance.



Reply With Quote
  #2  
Old 06-07-2019, 07:45 PM
macropod's Avatar
macropod macropod is offline reassemble fractured text Windows 7 64bit reassemble fractured text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Check out the Cleaning up Text Pasted from Websites, E-mails, PDFs etc. 'Sticky' thread at the top of this forum: http://www.msofficeforums.com/word/2...s-e-mails.html
You'll probably find the line word counts are inconsequential.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 06-08-2019, 06:32 AM
Chayes Chayes is offline reassemble fractured text Windows 7 32bit reassemble fractured text Office 2003
Advanced Beginner
reassemble fractured text
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

Ok thanks. I'll have a look at it.
Reply With Quote
  #4  
Old 06-08-2019, 08:13 AM
Chayes Chayes is offline reassemble fractured text Windows 7 32bit reassemble fractured text Office 2003
Advanced Beginner
reassemble fractured text
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

Hi


Ok thanks again. I ran the code from the link you sent. Very good. I think though it does a bigger job than I need really.



I suspect what I need could be centred around paragraph returns and full stops. So that at a return the text below is brought up , and ignored at full stops. Maybe other things too. I'll attach a sample file for to look at and hopefully it will be clearer.



The text in the sample becomes more and more fractured the further it goes on.



Anyway , I'm grateful for your advice. Much appreciated.




Very Best Wishes ,
Attached Files
File Type: doc sample 4.doc (47.0 KB, 7 views)
Reply With Quote
  #5  
Old 06-08-2019, 10:41 PM
macropod's Avatar
macropod macropod is offline reassemble fractured text Windows 7 64bit reassemble fractured text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

For your purposes, you could add:
.Font.Bold = False
before, say:
.MatchAllWordForms = False
and change:
ActiveDocument
to:
Selection
then select only the range you want to process. Even so, you will need to ensure there is an empty paragraph wherever a paragraph break is intended. Aside from that, the macro can be run as-is.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 06-09-2019, 07:06 AM
Chayes Chayes is offline reassemble fractured text Windows 7 32bit reassemble fractured text Office 2003
Advanced Beginner
reassemble fractured text
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

OK I made the amendments you suggested and it works perfectly! Thanks! I'm really grateful for your time and expertise.

Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
reassemble fractured text Text Field [content control] - Default text color vs Filled Text color jackcoletti Word 3 02-01-2017 08:10 AM
reassemble fractured text Drawing lines between text boxes which have actual text within the text boxes RHODIUM Word 6 10-01-2016 04:43 PM
Compare text from Bookmark with text from Text box Byron Polk Word VBA 4 07-30-2014 06:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:24 PM.


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