[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Mutilple word document changes

Posted on 2011-09-28
4
Medium Priority
?
201 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Suggested Courses

656 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