Solved

Mutilple word document changes

Posted on 2011-09-28
4
194 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 250 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.

738 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