Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2013, 10:52 PM
chamdan chamdan is offline word 2007 - Inserting value in the document header Windows 7 32bit word 2007 - Inserting value in the document header Office 2007
Novice
word 2007 - Inserting value in the document header
 
Join Date: Nov 2013
Posts: 13
chamdan is on a distinguished road
Lightbulb word 2007 - Inserting value in the document header

Hi,

I have document that contains a Text Form field and I would like to take the value of that text form field and insert it in the header. e.g.: see image below.

The document is protected to ensure that Text Form fields don't get erased.

My objective is to copy the value found in both text form fields into their corresponding cell in the header.



I am novice and would appreciate someone's help in providing me with a macro that would do it.

Regards,

Chuck
Attached Images
File Type: png MWSnap094.png (7.8 KB, 14 views)

Last edited by chamdan; 11-13-2013 at 11:02 PM. Reason: having problem Inserting the image
Reply With Quote
  #2  
Old 11-14-2013, 12:13 AM
macropod's Avatar
macropod macropod is offline word 2007 - Inserting value in the document header Windows 7 32bit word 2007 - Inserting value in the document header Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

There's a couple of ways of doing this:
1. Format the formfield with a unique character Style, then use a STYLEREF field in the header to reference that Style; or
2. Set the formfield's 'calculate on exit' property and insert a cross-reference to its internal bookmark in the header.
No code required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-14-2013, 05:58 AM
chamdan chamdan is offline word 2007 - Inserting value in the document header Windows 7 32bit word 2007 - Inserting value in the document header Office 2007
Novice
word 2007 - Inserting value in the document header
 
Join Date: Nov 2013
Posts: 13
chamdan is on a distinguished road
Default word 2007 - Inserting value in the document header

Hi Paul,

You are telling me to do certain thing that I have never done before and that is why I was asking if one can provide me with a sample? and appropriate macro to achieve that.

Would you be able to help?

Thanks in advance.

Chuck
Reply With Quote
  #4  
Old 11-14-2013, 06:15 AM
macropod's Avatar
macropod macropod is offline word 2007 - Inserting value in the document header Windows 7 32bit word 2007 - Inserting value in the document header Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

See attached. The field has an internal bookmark named 'Text1' and has the 'Strong' character Style applied. The header uses a STYLEREF field referencing the 'Strong' character Style and the footer uses a REF field referencing bookmark named 'Text1'.

You will note that the header updates as you type the text. The footer, though, won't update till you do a Print Preview.

As per my previous post, there are no macros needed for this.
Attached Files
File Type: docx Formfield Header-Footer.docx (24.6 KB, 13 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-14-2013, 05:16 PM
chamdan chamdan is offline word 2007 - Inserting value in the document header Windows 7 32bit word 2007 - Inserting value in the document header Office 2007
Novice
word 2007 - Inserting value in the document header
 
Join Date: Nov 2013
Posts: 13
chamdan is on a distinguished road
Default

Thank you Paul!

I managed to make it work while I was at work today by setting as you mentioned StyleRef and selected from the list the Formula and have set the name of my text Form field and it worked. But your example provided me with the facility of using text format, when the one I was using was numeric since I had used formula.

Anyway, I really appreciate your help.

Cheers!

Chuck
Reply With Quote
  #6  
Old 11-14-2013, 05:17 PM
chamdan chamdan is offline word 2007 - Inserting value in the document header Windows 7 32bit word 2007 - Inserting value in the document header Office 2007
Novice
word 2007 - Inserting value in the document header
 
Join Date: Nov 2013
Posts: 13
chamdan is on a distinguished road
Thumbs up Solved - word 2007 - Inserting value in the document header

Thank you Paul!

Cheers!

Chuck
Reply With Quote
  #7  
Old 11-15-2013, 08:24 AM
Charles Kenyon Charles Kenyon is offline word 2007 - Inserting value in the document header Windows 7 64bit word 2007 - Inserting value in the document header Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

More references
StyleRef Field
StyleRef Field Tutorial
Reply With Quote
  #8  
Old 11-15-2013, 05:06 PM
chamdan chamdan is offline word 2007 - Inserting value in the document header Windows 7 32bit word 2007 - Inserting value in the document header Office 2007
Novice
word 2007 - Inserting value in the document header
 
Join Date: Nov 2013
Posts: 13
chamdan is on a distinguished road
Default

Thank you for the Links Charles.

Cheers!

Chuck
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting one document into another Bluie Word 5 05-17-2012 12:00 PM
word 2007 - Inserting value in the document header Using Hyperlink to open Word Document at Specific Header rossi45 Word 2 05-04-2012 06:03 PM
header/footer not saving to gallery (word 2007) lloydc Word 0 04-30-2012 05:29 PM
word 2007 - Inserting value in the document header Powerpoint inserting and editing a word document Zeeb PowerPoint 2 02-12-2012 02:40 PM
Inserting citations using the reference function in Microsoft Word 2007? aeyara Word 0 09-28-2009 05:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:02 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