#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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] |
#3
|
|||
|
|||
Ok thanks. I'll have a look at it.
|
#4
|
|||
|
|||
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 , |
#5
|
||||
|
||||
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] |
#6
|
|||
|
|||
OK I made the amendments you suggested and it works perfectly! Thanks! I'm really grateful for your time and expertise.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Text Field [content control] - Default text color vs Filled Text color | jackcoletti | Word | 3 | 02-01-2017 08:10 AM |
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 |