?
Solved

Mutilple word document changes

Posted on 2011-09-28
4
Medium Priority
?
198 Views
Last Modified: 2012-05-12
hi everyone,
does anyone know of a way to change a footer within hundreds of word documents. I need to apply a address change to hundreds of word documents. I was hoping not to open each one at a time to do this.
Does this make sense?
the original documents were created with a set letterhead.

cheers
0
Comment
Question by:RodneyFirmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 36715660
You will have to Open them, but not manually.

You could put them in single folder, and run a macro like this
Sub EditDocs()
    Dim strFolder As String
    Dim strFile As String
    Dim doc As Document
    Dim sec As Section
    Dim ftr As HeaderFooter
    
    strFolder = "C:\MyFolder"
    strFile = Dir$(strFolder & "\*.doc*")
    Do Until strFile = ""
        Set doc = Documents.Open(strFolder & "\" & strFile)
        For Each sec In doc.Sections
            For Each ftr In sec.Footers
                ftr.Range.Text = "My New Company"
            Next ftr
        Next sec
        doc.Close wdSaveChanges
        strFile = Dir
    Loop
End Sub

Open in new window

0
 

Author Comment

by:RodneyFirmer
ID: 36914115
Thanks i haven't time to try this, the problem is also many documents within multiple folder structures.

Is there anyway of preventing this problem in the future.
cheers
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 750 total points
ID: 36915385
It would be quicker than doing each one manually,

If you expect to find some time in the near future, it might be worth us modifying the code to recurse down the folder structure, but of course there would need to be some test to see if the document is relevant, e.g. by doing a Find and Replace instead of just setting the text.

Future avoidance would depend on the way that the document files are used. If you are just want to distribute printouts, you could have the text somewhere external to the document, but accessible to you; for instance as an Autotext entry in a the document's template and displayed in an Autotext field.
0
 

Author Closing Comment

by:RodneyFirmer
ID: 36946162
Thnaks for all your help. ended up finding software to do this.

cheers
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question