Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 16th, 2006, 02:53 AM
Registered User
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy text from 1 doc to other doc thru vba in word

Need to copy values from other documents based on heading name and create a new document through VBA

 I my company i am working for a Department. This Department has 4 Divisions. Each Division will send their Weekly Highlights to My Department. I will select important topics from the 4 Word Documents which i received from Division and i place it in a new Document, this new document will be send to the management.

For example Each Division has a Heading named
'Productivity & Improvement And Cost Savings'
'HRD22 Gain'

under that they may have a heading containing the word 'HRD22 Gain' like this. So i have to pick all the paragraph which contains the word 'Gain' in their heading which come under 'Productivity & Improvement And Cost Savings'. Similar to the Example i said i have some more headings and some more sub headings which i have to do.

Every week i am doing this repeated process. I like to automate this. Is it possible to write VBA code. Where i can get a similar example or forum which could guide me.

I think when i open a new document and run the macro - all the required headings & paragraphs will copied from the four divisions will be pasted in this newly opened document. The code should do this or any other suggestions please.


Old November 22nd, 2006, 11:06 AM
Authorized User
Join Date: Nov 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts

could store the headings in a table and also store the selected header values in another table so when you need to generate the other 3 documents you can look up the selected header values and loop through each instance of the selected header - then look up the value of the selected header selected and insert the text, for me its easier to sore the values in an access database, let me know if that makes sense. When I have more time I could prvide a demo...

Old December 29th, 2006, 02:47 AM
GLM GLM is offline
Authorized User
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

sorry, but not for free


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy contents of Word doc & Paste in Excel - How?? robear Javascript How-To 1 August 23rd, 2006 03:22 PM
How to Copy contents of Word doc & Paste in Excel robear Pro PHP 0 August 21st, 2006 12:25 PM
how to copy date from doc files jitendersingal General .NET 0 February 13th, 2006 07:19 AM
How to insert an equation in a Word doc. Thru VBA? PedroZorro VB How-To 1 May 31st, 2005 12:36 PM
Copy word to word doc. in VB vamshi Pro VB 6 1 March 24th, 2004 06:25 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.