Results 1 to 10 of 10
  1. #1
    Lounger
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Word & UNC paths

    My company stores templates on a network drive. The drive just recently moved to a new server with a different UNC path. All Word documents created before the move take a looonng time to load. Documents created since, do not. Word appears to be looking for the old UNC path before giving up and using the existing template on the new server.

    I've identified a workaround of copying the old files into a new template, but this would involve hundreds of files.

    Is there a way of telling Word to quit looking in the original location?

    After reading what I've just written, does this make any sense?

    The network is an NT network, the workstations are all NT 4.0 and both Word 97 and 2000 are in use.

    Any suggestions would be appreciated.

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    Renton, Washington, USA
    Posts
    12,560
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Word & UNC paths

    You may try changing the template in the Advance Summary pane of the Properties of each file. The UNC path may be listed there, you could have the users do a right click in Windows Explorer and selecting Properties. I am NOT a macro person, but, if this can be can be manually, then one may be able to write a macro to do it to ALL.

    Now running HP Pavilion a6528p, with Win7 64 Bit OS.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word & UNC paths

    This is a real drama. I usually see this when someone sends me a file with a template attached and I don't have a template with the same name in either of my template directories.

    As far as I can tell it is not caused by NOT finding the template described in the attached path but rather by seeing it faintly in the distance and making you wait until it has opened the template across the WAN (which takes ages).

    If you know the name of the attached template (which you will do if you wait long enough), create a template with the same name and put it in your local template directory and see if that speeds up the action.

    Alternatively, if the server was decommissioned then make sure it has its templates moved or removed. Otherwise you could make up a macro to open each file in turn and maybe hijack each attached template with a FileOpen macro in Normal which resets the attached template to a local path.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

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

    Re: Word & UNC paths

    Hi All:

    Allen Wyatt has written a macro to make batch changes in attached templates. It is published in his weekly newsletter WordTips Premium for Jan 27,2001. You can sign up for the newsletter, if you wish, at

    <A target="_blank" HREF=http://www.VitalNews.com/>http://www.VitalNews.com/</A>

    He also has archives for his tips. I will ask him if it's OK to publish the macro here.

  5. #5
    Lounger
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word & UNC paths

    What advanced summary pane? I'm on NT 4.0 and have checked document properties through Word 2000 and Word 97 and can find no advanced summary property dialog.

  6. #6
    Lounger
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word & UNC paths

    The server that Word seems to be looking for no longer exists. All users have updated paths in Tools/Options/File Locations that reflect the new server. I have tried copying the template locally, but that does not help. Changing the template location through Tools/Templates and resaving the document works for Word 2000, but not in 97.

    To confuse matters more, documents opened in Word 2000 show the old UNC path to the template. The same file opened in 97 shows the current path.

    Curiouser and curiouser.

  7. #7
    Lounger
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word & UNC paths

    I have tried to locate the macro you mentioned, but have been unsuccessful so far. I would appreciate any further information along this line that you can forward.

    Thanks.

  8. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    Renton, Washington, USA
    Posts
    12,560
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Word & UNC paths

    When in the Summary tabbed pane look to the bottom there is a button that is "Simple" when in the Advance and is "Advance" when in the Simple pane.
    I am running Office 2000 on a Windows 2000 machine.

    Now running HP Pavilion a6528p, with Win7 64 Bit OS.

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

    Re: Word & UNC paths

    Hi Richard:

    I have contacted the author, Allen Wyatt, & he's given me
    permission to post the macro. Of course, I don't know for
    sure whether this will cure your particular problem, but I hope it helps.

    from WordTips Premium 1/27/01
    Batch Template Changes
    By Allen Wyatt
    <A target="_blank" HREF=http://www.VitalNews.com/WordTips/>http://www.VitalNews.com/WordTips/</A>
    ------------------------------
    "Templates are used to quickly define a standard look for
    a document or a group of documents. The wonderful thing
    about templates is that you can define one template to
    give your document one look, and another template to give
    it an entirely different look. All you need to do, of
    course, is change which template is associated with a
    document.

    Changing the template associated with one or two documents
    is quite easy. What if you have a directory full of
    documents whose templates need to be changed? This can
    get quite tedious very quickly. This is where a macro
    can come to the rescue--to relieve that old tedium and do
    the mundane very quickly. The following VBA macro,
    ChangeTemplates, will modify all the documents in a
    particular directory to make sure they use the template
    you want.

    <pre>Sub ChangeTemplates()
    Dim strDocPath As String
    Dim strTemplateB As String
    Dim strCurDoc As String
    Dim docCurDoc As Document

    ' set document folder path and template strings
    strDocPath = "Cath to document folder"
    strTemplateB = "Cath to templatetemplateB.dot"

    ' get first doc - only time need to provide file spec
    strCurDoc = Dir(strDocPath & "*.doc")

    ' ready to loop (for as long as file found)
    Do While strCurDoc <> ""
    ' open file
    Set docCurDoc = Documents.Open(FileName:=strDocPath & strCurDoc)
    ' change the template
    docCurDoc.AttachedTemplate = strTemplateB
    ' save and close
    docCurDoc.Close wdSaveChanges
    ' get next file name
    strCurDoc = Dir
    Loop
    MsgBox "Finished"
    End Sub</pre>



    In order to use the macro, simply make sure that the
    strDocPath and strTemplateB variables are set properly.
    The macro changes the template associations for all
    documents in a particular directory. If you want
    something a little more discriminating, then a different
    macro is in order. For instance, you may want to have
    the macro examine each document and only change those
    that use TemplateA so that they now use TemplateB. In
    this instance you will find the following VBA macro very
    handy:

    <pre>Sub TemplateBatchChange()
    Dim objPropertyReader
    Dim strFolder As String
    Dim strFileName As String
    Dim objThisDoc As Word.Document
    Dim strFindTemplate As String
    Dim strReplaceTemplate As String
    Dim strAffectedDocs As String

    On Error Resume Next

    'Create the PropertyReader object

    Set objPropertyReader = CreateObject("DSOleFile.PropertyReader")
    If Err.Number <> 0 Then
    MsgBox "You must install the DSOleFile component. See " & _
    "http://support.microsoft.com/support/kb/articles/Q224/3/51.ASP"
    GoTo FinishUp
    End If

    'Get the template names
    strFindTemplate = UCase(InputBox("Name of template to find (exclude the .dot)") & _
    ".dot")

    strReplaceTemplate = InputBox("Name of replacement template (exclude the .dot)") & _
    ".dot"

    'Make sure it's a valid template. Try to create a new document based on it.
    Set objThisDoc = Word.Documents.Add(strReplaceTemplate, Visible:=False)
    If Err.Number <> 0 Then
    'No such template
    MsgBox "There is no accessible template named " & strReplaceTemplate
    GoTo FinishUp
    End If
    'Close the test document
    objThisDoc.Close wdDoNotSaveChanges

    On Error GoTo ErrorHandler
    'Get the current documents path
    strFolder = Word.Application.Options.DefaultFilePath(wdDocumen tsPath) _
    & Word.Application.PathSeparator

    'Examine all Word documents in the directory

    'Get the first document name
    strFileName = Dir(strFolder & "*.doc")

    While strFileName <> ""
    'Look at the template name
    If UCase(objPropertyReader.GetDocumentProperties _
    (strFolder & strFileName).Template) = strFindTemplate Then

    'It matches. Open the document
    Set objThisDoc = Word.Documents.Open _
    (FileName:=strFileName, Visible:=False)

    'Change the attached template
    objThisDoc.AttachedTemplate = strReplaceTemplate

    'Save the change
    objThisDoc.Close wdSaveChanges

    'Note the document
    strAffectedDocs = strAffectedDocs & strFileName & ", "
    End If
    'Get the next document
    strFileName = Dir
    Wend

    'Report the results
    If strAffectedDocs = "" Then
    MsgBox "No documents were changed.", , "Template Batch Change"
    Else
    'Remove the trailing comma and space
    strAffectedDocs = Left(strAffectedDocs, Len(strAffectedDocs) - 2)

    MsgBox "These documents were changed: " & _
    strAffectedDocs, , "Template Batch Change"
    End If
    GoTo FinishUp

    ErrorHandler:
    Set objThisDoc = Nothing
    Set objPropertyReader = Nothing
    Err.Raise vbError + 1001, "TemplateBatchChange", _
    "TemplateBatchChange encountered an error: " & Err.Description

    FinishUp:
    'Release object references
    Set objThisDoc = Nothing
    Set objPropertyReader = Nothing
    End Sub</pre>



    In order to use this macro, you must first make sure that
    the DSOLEFILE component (available free from Microsoft)
    is installed on your system. You can find out more about
    this component by referring to Microsoft's Q224351
    KnowledgeBase article. The macro provides you a chance
    to specify a template name to be replaced and the name of
    the template to replace it with. It even checks to make
    sure that the replacement template exists.

    This macro searches for documents in the default Word
    document folder. If you want to search in a different
    directly, you should make sure that the strFolder
    variable gets set to the full path of the folder you want
    used.

    (Thanks to Graham Smith, Leigh Webber, David G. Lett, and
    Gary Frieder for contributing to this tip.)"

  10. #10
    Lounger
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word & UNC paths

    Yes! This works great. It even leaves the existing file date intact.

    Thank you!

Posting Permissions

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