Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2016, 10:03 AM
jthomas666 jthomas666 is offline Form fields for text that is to be used later in the document Windows 7 64bit Form fields for text that is to be used later in the document Office 2016
Competent Performer
Form fields for text that is to be used later in the document
 
Join Date: Jun 2016
Location: Warner Robins, GA
Posts: 200
jthomas666 will become famous soon enough
Default Form fields for text that is to be used later in the document

I am working on a template for software release documents. The title page will have the version number. We also need to have the version number in the header/footer.

Is it possible to create a field on the title page for entry of the version, and have Word then autoinsert that info into the header?

Last edited by Charles Kenyon; 06-15-2016 at 02:51 PM. Reason: Mark as solved
Reply With Quote
  #2  
Old 06-14-2016, 12:42 PM
Charles Kenyon Charles Kenyon is offline Form fields for text that is to be used later in the document Windows 8 Form fields for text that is to be used later in the document Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,470
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

No input field needed. Use a StyleRef Field to put your version number in the header/footer. You would want to use a custom character style for your version number.

Other methods:Repeating Data (Populating Multiple Like Fields)
Reply With Quote
  #3  
Old 06-15-2016, 09:36 AM
jthomas666 jthomas666 is offline Form fields for text that is to be used later in the document Windows 7 64bit Form fields for text that is to be used later in the document Office 2016
Competent Performer
Form fields for text that is to be used later in the document
 
Join Date: Jun 2016
Location: Warner Robins, GA
Posts: 200
jthomas666 will become famous soon enough
Default

Tangentially related--is there a command to update all fields in a document?
Reply With Quote
  #4  
Old 06-15-2016, 02:47 PM
Charles Kenyon Charles Kenyon is offline Form fields for text that is to be used later in the document Windows 8 Form fields for text that is to be used later in the document Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,470
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

Not really. The thing is that Word puts things in layers or containers.

See the example given by Graham Mayor here: Installing Macros.

I believe that the following is the most thorough macro to do this that I've encountered. It comes from Greg Maxey in this thread.

Code:
Sub UpdateAllFieldsAllStoryMaxey()    ' Greg Maxey
    ' http://answers.microsoft.com/en-us/office/forum/office_2007-word/how-to-update-all-fields-in-a-document-at-once/54b43181-0ea7-4abc-bfb9-e0555125dfe5?page=5
    Dim rngStory As Word.Range
    Dim lngJunk As Long
    Dim oShp As Shape
    Dim oToc As TableOfContents, oToa As TableOfAuthorities, oTof As TableOfFigures
    lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
    For Each rngStory In ActiveDocument.StoryRanges
      'Iterate through all linked stories
      Do
        On Error Resume Next
        rngStory.Fields.Update
        Select Case rngStory.StoryType
          Case 6, 7, 8, 9, 10, 11
            If rngStory.ShapeRange.Count > 0 Then
              For Each oShp In rngStory.ShapeRange
                If oShp.TextFrame.HasText Then
                   oShp.TextFrame.TextRange.Fields.Update
                End If
              Next
            End If
          Case Else
            'Do Nothing
        End Select
        On Error GoTo 0
        'Get next linked story (if any)
        Set rngStory = rngStory.NextStoryRange
      Loop Until rngStory Is Nothing
      'Special Cases
      For Each oToc In ActiveDocument.TablesOfContents
        oToc.Update
      Next oToc
      For Each oToa In ActiveDocument.TablesOfAuthorities
        oToa.Update
      Next
      For Each oTof In ActiveDocument.TablesOfFigures
        oTof.Update
      Next
    Next
End Sub
-
My experience, though, is that StyleRef fields update instantly when in a header or footer. I believe that this is true when they are in the body of a document as well but am not certain. I do know that they update much better than do REF fields.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form fields for text that is to be used later in the document Creating a Form with Fields that will Populate into Another Document Mobius Word 3 05-06-2016 12:46 AM
Macro to keep formatted form fields after mail merge or replace text with formatted form fields jer85 Word VBA 2 04-05-2015 10:00 PM
Form fields for text that is to be used later in the document Multiple Text Fields in Form robstark Word 1 08-11-2014 11:26 AM
Extract form fields to Word Document RonNCmale Word VBA 22 01-11-2014 05:06 AM
Form fields for text that is to be used later in the document Form Fields - Create blank form text field with if statement? LAssist2011 Word 5 12-14-2011 03:02 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:54 AM.


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