+ Post New Thread
Results 1 to 9 of 9
Office Software Thread, Automatically Updating Field Codes in Technical; I'm (still) trying to get a person's name into the footer of every new Word document that's created. I thought ...
  1. #1

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,675
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    45

    Automatically Updating Field Codes

    I'm (still) trying to get a person's name into the footer of every new Word document that's created. I thought I had it cracked until I noticed that Word only updates some field codes when you print. So whist if someone prints/pront priviews a document their username changes until they do it has my name in the footer. I could enter somthing random like "your username will be inserted here" but I don't want to. I want to have their username from the word go.

    I've been looking on google and I can't see a way to force the codes to auto update without using a Macro? Is there a way for force a field to update all the time the same way the data does?

    I've used the record macro feature to record a macro to update the field codes if you go to file and new (AutoNew) or open an exiisting document (AutoOpen). The problem is that I can't get it to work for the document that opens when you first click on Word. If I create an "AutoExec" macro it fails, presumably because the document isn't open. I've included my macor below. Any ideas how to get it to work when I start a new Word?

    Code:
        WordBasic.ViewFooterOnly
        Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
        Selection.Fields.Update
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

  2. #2

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,848
    Thank Post
    671
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    Can you add a macro to the template i.e. normal.dot and then it will be the default for all new instances of word. in 2007, it is called normal.dotm i think.

  3. #3

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,848
    Thank Post
    671
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    Actually, you probably wont need a macro, if you can edit the normal.dotm and put it on everyone's machine, or set their profiles to use your modified one.

  4. #4

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,675
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    45
    Your right it is .dotm. And I have been forced into macro's as the cant get the code to auto update when I want it by itself.
    The problem is that my Macro works when existing documents are opened. The Macro works when New documents are created (Office Button, New) but it doesn't work when you click on the Word Icon and open Word and are presented with a document. I can't seem to work out where to put it to make it work.

    the field code will update when you print which is OK ish.... but I want it to be perfect to help the hard of thinking.

  5. #5

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,675
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    45
    Quote Originally Posted by vikpaw View Post
    Actually, you probably wont need a macro, if you can edit the normal.dotm and put it on everyone's machine, or set their profiles to use your modified one.
    That's where I went first. The problem is that it then had MY name in the footer until the user perfoms an action to update the field codes. These mostly seem to be print/print preview. Until that point my name is going to be on the bottom of the document which is going to confuse...

  6. #6

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,848
    Thank Post
    671
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    But, can't you put a macro into a template. if not, if you add the field code into the template, then just opening Word, will default to a new blank document with the field code applied.... wont it?
    Other than that, tell them to do a Ctrl+A and then F9 to force update. but you have to be in the footer if the field is in the footer for this to work.

  7. #7

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,848
    Thank Post
    671
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    ok, i think i got ya now. what if you put it in that mode where it displays the code not the value / result. i don't suppose that helps.
    it's bizarre, that it resolves the value and saves it into the template.
    maybe you could set the template up with an account that is called "user" so at least it's not a name until they update...

  8. #8

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,675
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    45
    I've resoted to rediting my registry to have the details "You name will be entered here".
    I have an AutoOpen Macro which updates the code for documents as they are opened. I have an AutoNew which updates new documents when they are created for file New. I tried AutoExec for when Word was opened but it executed prior to the document opening so just errors (you can't selecet and update things that are not open!)

    Blooming Microsoft!

  9. #9

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,848
    Thank Post
    671
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    :O) shame. maybe there's an office tool kit tool that can help, or it's fixed in 2010. if i remember i'll take a look tomorrow.

SHARE:
+ Post New Thread

Similar Threads

  1. QR Codes and Microsoft Tag
    By Tamarside in forum Netbooks, PDA and Phones
    Replies: 2
    Last Post: 9th February 2009, 01:33 PM
  2. Replies: 11
    Last Post: 16th October 2008, 05:10 PM
  3. Replies: 4
    Last Post: 17th December 2007, 05:15 PM
  4. Replies: 0
    Last Post: 10th December 2007, 04:48 PM
  5. exam-codes
    By callumtuckey in forum General Chat
    Replies: 14
    Last Post: 24th August 2007, 09:52 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •