|
-
Nov 18th, 2017, 12:05 AM
#4
Fanatic Member
Re: WORD VBA to create block text
im a bit rusty with the VBA on word.
but i would do it something like this
id first ignore all the text and get all the objects converted like bullets, tables, and anything else that is in there, create a sub for each one.
so for example bullet lists. Create a sub to loop through the list pull out the text of each one and then simply join it all together however you want and then use this sub in your MAIN loop that proccess or goes through the document looking for things to change.
lets say you want to remove all pictures, just add in your MAIN IF a picture is found just delete it etc etc...
what you will be left with is a very messy document with text and spaces all over the place, now all you need to do is change all tab stops to spaces, change all double spaces to single spaces (setup a recursive loop for that, just check every space in front and if its a space delete it and recal the recursive funtion) something like that, and then finally make sure there is a space after each fullstop.....
This job requires a step by step process, it might take a while to finish but once its done watching it work is quite satisfying.. just add some screen updates so you can watch it
Yes!!!
Working from home is so much better than working in an office...
Nothing can beat the combined stress of getting your work done on time whilst
1. one toddler keeps pressing your AVR's power button
2. one baby keeps crying for milk
3. one child keeps running in and out of the house screaming and shouting
4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
5. working at 1 O'clock in the morning because nobody is awake at that time
6. being grossly underpaid for all your hard work

Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|