Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    template field update (office XP)

    Hi,
    I work in a large organisation that has recently updated from Office 98 to XP and the normal templates that used to work well do not anymore.
    In the footer we have inserted the field filename and path, this use to update wonderfully. Now it only updates sometimes and on some machines.
    On some machines you have to select under options Print tab update field for it to work on some you do not.
    Also we have found a macro that does force an update on normal.dot, however this would mean going to everyones machine and adding it.
    And of course we have the problem of humans - unticking the print option box, on a friday afternoon.
    Is there another way around? Why has this function changed - it is hard to explain to users why something that use to work is now not.

    thanks for the help and advice
    Sharron

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: template field update (office XP)

    Hi Sharron,

    Similar questions have been asked in this forum in the recent past (see for instance <post#=275196>post 275196</post#>) and I'm beginning to think that this is a bug in Word 2000/2002. The updating of fields seems to be inconsistent, as you found out it works for some users and some of the time.

    In a network environment, you could force the Startup location (Tools | Options..., File Locations tab) to point to a shared network folder. Templates placed in this folder would serve as global templates; you could store the macro you mention in such a global template.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: template field update (office XP)

    Hi,

    I've had the same problem, however, in most of the company templates, I have selected the entire path and created a bookmark called 'filename'. I have 2 macros in the templates, one FileSave and one FileSaveAs which when saving either way, will select the path and update it. If you're interested, let me know and I'll try and post it.

  4. #4
    New Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: template field update (office XP)

    Hi Leanne
    Your macro's sound like just the right thing. It would be good to have a look, if you could post them.
    thanks
    Sharron

  5. #5
    New Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: template field update (office XP)

    thanks Hans,
    with the search facility down, I didn't bother to check. So thank you for pointing me in the correct direction. It is a shame that they seem to be getting resolved by deleting the fields and recreating them, not something I want to do company wide.
    Sharron

  6. #6
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: template field update (office XP)

    Sharron,

    Here are the two macros:

    Sub FileSave()
    '
    ' FileSave Macro
    On Error Resume Next
    ActiveDocument.Save
    With ActiveDocument.Bookmarks
    .Add Range:=Selection.Range, Name:="QuickMark"
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    Selection.GoTo What:=wdGoToBookmark, Name:="Filename"
    Selection.Fields.Update
    With ActiveDocument.Bookmarks
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    Selection.Fields.Update
    Selection.GoTo What:=wdGoToBookmark, Name:="QuickMark"
    With ActiveDocument.Bookmarks
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    End Sub


    and

    Sub FileSaveAs()
    '
    ' FileSaveAs Macro
    On Error Resume Next
    dlgAnswer = Dialogs(wdDialogFileSaveAs).Show
    With ActiveDocument.Bookmarks
    .Add Range:=Selection.Range, Name:="QuickMark"
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    Selection.GoTo What:=wdGoToBookmark, Name:="Filename"
    Selection.Fields.Update
    With ActiveDocument.Bookmarks
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    Selection.Fields.Update
    Selection.GoTo What:=wdGoToBookmark, Name:="QuickMark"
    With ActiveDocument.Bookmarks
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    End Sub

    Again, on each of your templates, select the entire path/filename, create a bookmark called "Filename" since that is what the macros look for.

    Hope this helps.

  7. #7
    New Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: template field update (office XP)

    Hi Leanne,
    I have been playing around with these two macro's and with a bit of alteration got them to work, thank you very much.
    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: template field update (office XP)

    What happened when you tried to use them as is? Could you post the alterations?
    Thanks,

  9. #9
    New Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: template field update (office XP)

    When I tried to run the macro's as is the fields wouldn't update, so I changed to macro to select the footer and then do an update. This seems to be working on my machine, haven't tried it on someone elses yet.
    I am a bit shy about posting my alterations as I am definately not a VB writer, so I am sure it could be written better, but here you are:
    Sub FileSave()
    '
    ' FileSave Macro
    On Error Resume Next
    ActiveDocument.Save
    'ActiveDocumtent.Fields.Update

    With ActiveDocument.Bookmarks
    .Add Range:=Selection.Range, Name:="QuickMark"
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
    ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
    ActivePane.View.Type = wdOutlineView Then
    ActiveWindow.ActivePane.View.Type = wdPrintView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    If Selection.HeaderFooter.IsHeader = True Then
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
    Else
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    End If
    Selection.Fields.Update
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

    Selection.GoTo what:=wdGoToBookmark, Name:="QuickMark"
    With ActiveDocument.Bookmarks
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    End Sub




    Sub FileSaveAs()
    '
    ' FileSaveAs Macro
    On Error Resume Next
    dlgAnswer = Dialogs(wdDialogFileSaveAs).Show
    With ActiveDocument.Bookmarks
    .Add Range:=Selection.Range, Name:="QuickMark"
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
    ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
    ActivePane.View.Type = wdOutlineView Then
    ActiveWindow.ActivePane.View.Type = wdPrintView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    If Selection.HeaderFooter.IsHeader = True Then
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
    Else
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    End If
    Selection.Fields.Update
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    Selection.GoTo what:=wdGoToBookmark, Name:="QuickMark"
    With ActiveDocument.Bookmarks
    .DefaultSorting = wdSortByName
    .ShowHidden = False
    End With
    End Sub

    thanks
    Sharron

Posting Permissions

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