Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2011, 08:54 AM
sqzdog sqzdog is offline Adding identical footers to 187 separate docs Windows XP Adding identical footers to 187 separate docs Office 2007
Novice
Adding identical footers to 187 separate docs
 
Join Date: Apr 2011
Posts: 7
sqzdog is on a distinguished road
Default Adding identical footers to 187 separate docs

I have 187 word documents that I need to add the same footer to. Is there any way to do this without having to do them individually?
Reply With Quote
  #2  
Old 04-05-2011, 06:27 AM
macropod's Avatar
macropod macropod is offline Adding identical footers to 187 separate docs Windows 7 32bit Adding identical footers to 187 separate docs Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi sqzdog,

Do any of the documents already have anything in the footers that needs to be preserved and, if so, is your std footer content to be inserted before, or after, the existing content?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-05-2011, 07:16 AM
sqzdog sqzdog is offline Adding identical footers to 187 separate docs Windows XP Adding identical footers to 187 separate docs Office 2007
Novice
Adding identical footers to 187 separate docs
 
Join Date: Apr 2011
Posts: 7
sqzdog is on a distinguished road
Default

There is nothing in the footer on these documents.
Reply With Quote
  #4  
Old 04-19-2011, 02:56 PM
macropod's Avatar
macropod macropod is offline Adding identical footers to 187 separate docs Windows 7 32bit Adding identical footers to 187 separate docs Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi sqzdog,

Try something along the lines of:
Code:
Sub UpdateDocuments()
Application.ScreenUpdating = False
Dim strFolder As String, strFile As String, wdDoc As Document
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc", vbNormal)
While strFile <> ""
  Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False)
  With wdDoc.Sections(1).Footers(wdHeaderFooterPrimary).Range
    .Text = "My Footer Text"
    With .Font
      .Size = 15
      .Name = "Arial"
      .Bold = True
    End With
  End With
  wdDoc.Close SaveChanges:=True
  strFile = Dir()
Wend
Set wdDoc = Nothing
Application.ScreenUpdating = True
End Sub
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-19-2011, 04:22 PM
sqzdog sqzdog is offline Adding identical footers to 187 separate docs Windows XP Adding identical footers to 187 separate docs Office 2007
Novice
Adding identical footers to 187 separate docs
 
Join Date: Apr 2011
Posts: 7
sqzdog is on a distinguished road
Default

Thank you for the reply, but I have no idea what to do with that code! Can you assist?
Reply With Quote
  #6  
Old 04-19-2011, 07:59 PM
macropod's Avatar
macropod macropod is offline Adding identical footers to 187 separate docs Windows 7 32bit Adding identical footers to 187 separate docs Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi sqzdog,

What you would do is install the macro in to, say, a new document, then run the 'UpdateDocuments' sub. This will display a prompt for you to navigate to the folder where the documents are and then it will automatically insert some text into the footer of every document in that folder.

As coded, the macro I posted will put the words "My Footer Text" into the main footer of every document in a chosen folder, in 15pt Arial bold. You can change any of these attributes, or use different ones (eg italic, red text, etc).

If you don't know how to install/use a macro see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 04-21-2011, 08:00 AM
sqzdog sqzdog is offline Adding identical footers to 187 separate docs Windows XP Adding identical footers to 187 separate docs Office 2007
Novice
Adding identical footers to 187 separate docs
 
Join Date: Apr 2011
Posts: 7
sqzdog is on a distinguished road
Default

You have NO IDEA how much time and effort you saved me. Thank you!!

This worked like a charm. Is there a way to center the text in the footer, if not, no big deal. Just happy to have it finished!!
Reply With Quote
  #8  
Old 04-21-2011, 01:23 PM
macropod's Avatar
macropod macropod is offline Adding identical footers to 187 separate docs Windows 7 32bit Adding identical footers to 187 separate docs Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi sqzdog,

You could add a centring function after the line:
With wdDoc.Sections(1).Footers(wdHeaderFooterPrimary).R ange
Simply insert:
.Paragraphs.First.Alignment = wdAlignParagraphCenter
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 04-21-2011, 01:39 PM
sqzdog sqzdog is offline Adding identical footers to 187 separate docs Windows XP Adding identical footers to 187 separate docs Office 2007
Novice
Adding identical footers to 187 separate docs
 
Join Date: Apr 2011
Posts: 7
sqzdog is on a distinguished road
Default

Thanks for your help
Reply With Quote
  #10  
Old 10-19-2011, 08:27 AM
sqzdog sqzdog is offline Adding identical footers to 187 separate docs Windows XP Adding identical footers to 187 separate docs Office 2007
Novice
Adding identical footers to 187 separate docs
 
Join Date: Apr 2011
Posts: 7
sqzdog is on a distinguished road
Default

Now, I need to do the same thing for the header. Using the code in the previous post, what do I change to make changes to the headers in the 187 files?
Reply With Quote
  #11  
Old 10-25-2011, 12:23 PM
sqzdog sqzdog is offline Adding identical footers to 187 separate docs Windows XP Adding identical footers to 187 separate docs Office 2007
Novice
Adding identical footers to 187 separate docs
 
Join Date: Apr 2011
Posts: 7
sqzdog is on a distinguished road
Default

Paging Macropod.... can you help me? See above.
Reply With Quote
  #12  
Old 10-31-2011, 01:46 AM
macropod's Avatar
macropod macropod is offline Adding identical footers to 187 separate docs Windows 7 64bit Adding identical footers to 187 separate docs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi sqzdog,

I'm travelling with only intermitent internet access, hence the delay in replying.

What you're asking is a rather trivial task (and should have been fairly obvious) - change:
With wdDoc.Sections(1).Footers(wdHeaderFooterPrimary).R ange
to:
With wdDoc.Sections(1).Headers(wdHeaderFooterPrimary).R ange

or, if you want to combine both routines into the same code, simply duplicate the:
With wdDoc.Sections(1).Footers(wdHeaderFooterPrimary).R ange
...
End With
block and make the above change to one of them.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any easy way to separate a Word document into separate files? SamHelm Word 0 08-21-2010 05:29 AM
Adding identical footers to 187 separate docs Cannot open two separate MS word window bunny_biceps Word 2 08-17-2010 01:51 PM
Headers and Footers OverAchiever13 Word 1 05-27-2010 01:30 PM
Adding identical footers to 187 separate docs CHALLENGE! Issue sorting data containing relative references on a separate tab lax828 Excel 3 01-07-2010 11:28 AM
Can I separate a word Doc (docx) from the template used to create it (dotx)? paulnevlud Word 2 12-14-2009 10:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft