|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Need help extracting specific text from one doument to another with macro/VBA.
I am currently trying to automate some of my processes at work to become more efficient.
Every week I make a report to send to my supervisor in Word. I would like to run a macro that at the end when the report is finished I can run a macro that copies particular sections of my report and copies them into a new "template" document that I send to a different supervisor. (And maybe even link that process to Microsoft Outlook to attach the files and insert appropriate text.) I have tried the Record Macro feature and I just can't get anything going. I would love to take the time to really learn VBA, but that doesn't seem like any easy task. Any information would be helpful. Thank you. |
#2
|
||||
|
||||
Hi zsmithku,
The easiest way is to simply delete the unwanted material and save what's left to a new file. before you can even do that, though, Word would need a reliable means of identifying what parts to keep/delete. One way this could be done is via Section breaks, so that you could tell Word to delete, say, Sections 3-5,7 & 9. Of course, if this is going to be hard-coded, you would have to ensure that the document always had the same Section structure. As an alternative, you could simply bookmark the portions you want replicated (each portion needs a different bookmark) and, in another document, use INCLUDETEXT fields pointing to those bookmarks. If you do that, changes in the 'source' document automatically update in the 'target' document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help on Macro 03- Find text - if text is blank then remove line | simpleonline1234 | Word VBA | 1 | 02-25-2011 02:28 AM |
Selecting specific text out of a series of columns | speedycorn1 | Word | 3 | 11-01-2010 02:58 PM |
extracting data from Table to text file | Anirudh_Dsp | Word Tables | 1 | 05-23-2010 07:48 AM |
Strip lf/cr from text | p3aul | Word | 9 | 08-18-2009 12:42 AM |
Extracting Cell color | bsaucer | Excel | 1 | 06-19-2009 06:52 AM |