Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-25-2022, 08:20 AM
Yuvahari Yuvahari is offline Updating Headers & Footers from Database Windows 10 Updating Headers & Footers from Database Office 2010
Novice
Updating Headers & Footers from Database
 
Join Date: Jan 2022
Posts: 3
Yuvahari is on a distinguished road
Thumbs up Updating Headers & Footers from Database

Hi All,

I would like to change the Headers & Footers for the file from the folder based on the database.

Like, I have the database for File Name, Headers and Footers. Would like to have a Word VBA where it should update Headers and footers based on the data base.



For Example:

Database:

Filename | Headers | Footers
AE.Docx | AE Sample Headers | AE Sample Footers
Reply With Quote
  #2  
Old 01-26-2022, 03:45 PM
Guessed's Avatar
Guessed Guessed is offline Updating Headers & Footers from Database Windows 10 Updating Headers & Footers from Database Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Headers and footers are formatted ranges which don't lend themselves to plain text held in a database. Are you intending to insert unformatted text into a specific location in the header/footer or inserting a complete replacement header/footer?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 01-30-2022, 11:37 PM
Yuvahari Yuvahari is offline Updating Headers & Footers from Database Windows 10 Updating Headers & Footers from Database Office 2010
Novice
Updating Headers & Footers from Database
 
Join Date: Jan 2022
Posts: 3
Yuvahari is on a distinguished road
Default

Would like to inserting a complete replacement header/footer as per the data base file.

Can we do that ?
Reply With Quote
  #4  
Old 01-30-2022, 11:44 PM
Guessed's Avatar
Guessed Guessed is offline Updating Headers & Footers from Database Windows 10 Updating Headers & Footers from Database Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Yes it can be done but we can't help you directly without knowing information like your intended workflow and database structure.

Perhaps you should investigate mail merges to see how to link fields in Word to a database. That methodology would avoid the need for using VBA to get the link.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 01-30-2022, 11:50 PM
Yuvahari Yuvahari is offline Updating Headers & Footers from Database Windows 10 Updating Headers & Footers from Database Office 2010
Novice
Updating Headers & Footers from Database
 
Join Date: Jan 2022
Posts: 3
Yuvahari is on a distinguished road
Default

Thanks for the Suggestion.

Actually I would like to do it for bulk files, thats why i wanted to try through VBA.

For EX: I have the files - ABC.docx, DEF.docx, GHI.docx, JKL.docx.

And I have the data base for the headers & footers for these file.
Like If file name is ABC.docx, then Headers text should be "ABC Headers" & footers text shoudl be "ABC Footers". Same goes for remaining File.

I wanted to do a automation, where it should check the file name in the folder and correct headers & footers as per the database which i have.

P.S: database which i am referring to is Excel file data base.
Reply With Quote
  #6  
Old 01-31-2022, 10:12 PM
Guessed's Avatar
Guessed Guessed is offline Updating Headers & Footers from Database Windows 10 Updating Headers & Footers from Database Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You can get information from Excel in a range of different ways. Here is one example
https://www.msofficeforums.com/word-...orm-entry.html

Choosing to open a file based on a filename is shown in this thread https://www.msofficeforums.com/word-...cel-macro.html

Putting content into a header can be a bit more complex as we still don't know whether you want to add or replace content and how many headers are present in each document. If you get the rest of the code working, post the code you have come up with and we can finish it off.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
bulk, headers & footers, word vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating Headers & Footers from Database headers/footers scot Word 3 05-22-2015 09:45 AM
Updating Headers & Footers from Database Headers and Footers Kingsmoss Word 3 04-28-2014 02:43 PM
Updating Headers & Footers from Database Odd and Even Headers/Footers sarineochaos Word 1 02-04-2014 06:15 PM
Updating Headers & Footers from Database Headers and Footers teza2k06 Word 1 05-14-2013 11:07 AM
Headers and Footers OverAchiever13 Word 1 05-27-2010 01:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:45 AM.


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