Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] NeCrite.nl@gmail.com is offline
external usenet poster
 
Posts: 4
Default filelocations in worddocument

Okay,

I know how to get the { Filename \p } in the footer and how to update
it manually.
I want a .dot file, which will be saved as normal.dot for all users
here to use it.
But what I want is that after I put in that line it automatically
updates the filelocation with path after I save or after it could be
changed.

Cause from what I can see now is that it doesn't automatically updates
the filename and I have to press F9 or Alt-F9 in Word 2003.

How can I do this or some advice please.

Best regards,

René Klomp

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] NeCrite.nl@gmail.com is offline
external usenet poster
 
Posts: 4
Default filelocations in worddocument

I am going to try this later today, thank you for your response.

Does anyone know a simple way to put aa file location footer in
existing documents?

Best regards,

René

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default filelocations in worddocument

If you mean insert into the currently open document then

Sub InsertFilenameFooter()
With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
End With
Selection.EndKey Unit:=wdStory
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldFileName, Text:="\p", _
PreserveFormatting:=False
With ActiveWindow.ActivePane.View
.SeekView = wdSeekMainDocument
End With
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
I am going to try this later today, thank you for your response.

Does anyone know a simple way to put aa file location footer in
existing documents?

Best regards,

René



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] NeCrite.nl@gmail.com is offline
external usenet poster
 
Posts: 4
Default filelocations in worddocument

Hehe what I mean is that there are like thousands of files that don't
have the filename in the document.
Is there a quick way to get the filename in the footer for all...

Maybe I am too hopefull



  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default filelocations in worddocument

Use the following instead - however I would test on copies of the files.

Sub BatchAddFilename()
Dim myFile As String
Dim PathToUse As String
Dim MyDoc As Document
Dim iFld As Integer

With Dialogs(wdDialogCopyFile)
If .Display 0 Then
PathToUse = .Directory
Else
MsgBox "Cancelled by User"
Exit Sub
End If
End With
If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
If Left(PathToUse, 1) = Chr(34) Then
PathToUse = Mid(PathToUse, 2, Len(PathToUse) - 2)
End If
myFile = Dir$(PathToUse & "*.do?")
While myFile ""
Set MyDoc = Documents.Open(PathToUse & myFile)
Selection.EndKey Unit:=wdStory
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.EndKey Unit:=wdStory
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldFileName, Text:="\p", _
PreserveFormatting:=False
With ActiveWindow.ActivePane.View
.SeekView = wdSeekMainDocument
End With
MyDoc.Close SaveChanges:=wdSaveChanges
myFile = Dir$()
Wend
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


wrote:
Hehe what I mean is that there are like thousands of files that don't
have the filename in the document.
Is there a quick way to get the filename in the footer for all...

Maybe I am too hopefull



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default filelocations in worddocument

See
How to Find & ReplaceAll on a Batch of Documents in the Same Folder
http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

Replace text on a batch of files
http://www.gmayor.com/batch_replace.htm
http://gregmaxey.mvps.org/VBA_Find_And_Replace.htm

One or more of these articles should give you a starting point for inserting
text in a batch of documents.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


wrote in message
oups.com...
Hehe what I mean is that there are like thousands of files that don't
have the filename in the document.
Is there a quick way to get the filename in the footer for all...

Maybe I am too hopefull


  #8   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] NeCrite.nl@gmail.com is offline
external usenet poster
 
Posts: 4
Default filelocations in worddocument

In the script of Graham, how do I let it place an enter before
importing the file location in the document?

Thanks

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:04 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"