Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Harrison Tony Harrison is offline
external usenet poster
 
Posts: 8
Default Word 2007 - put footer onto every new document when Word starts

Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office Button,
New, my templates, Normal then it works fine, but what I want is when the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each machine,
but can make changes in Group Policy or via the login script (to copy files
into locations, etc).

Any help is gratefully received
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word starts

It is not a good idea to have a footer in the normal template. For a start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until the
document is saved. It would be better either to create a document template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the filename
and path in each footer of each section of the document after any existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office Button,
New, my templates, Normal then it works fine, but what I want is when the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word starts


It is not a good idea to have a footer in the normal template. For a start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until the
document is saved. It would be better either to create a document template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the filename
and path in each footer of each section of the document after any existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office Button,
New, my templates, Normal then it works fine, but what I want is when the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Harrison Tony Harrison is offline
external usenet poster
 
Posts: 8
Default Word 2007 - put footer onto every new document when Word start

Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents, and
certainly nothing in the footer stage. Obviously something with my set up or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until the
document is saved. It would be better either to create a document template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the filename
and path in each footer of each section of the document after any existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office Button,
New, my templates, Normal then it works fine, but what I want is when the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received



.

  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Harrison Tony Harrison is offline
external usenet poster
 
Posts: 8
Default Word 2007 - put footer onto every new document when Word start

Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents, and
certainly nothing in the footer stage. Obviously something with my set up or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until the
document is saved. It would be better either to create a document template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the filename
and path in each footer of each section of the document after any existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office Button,
New, my templates, Normal then it works fine, but what I want is when the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received



.



  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word start

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents,
and
certainly nothing in the footer stage. Obviously something with my set up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received



.



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word start

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents,
and
certainly nothing in the footer stage. Obviously something with my set up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received



.



  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default Word 2007 - put footer onto every new document when Word start

Note that adding the macro to the template won't affect already
existing documents based on that template, but only new documents
created from it.

On Jun 1, 1:47*am, "Graham Mayor" wrote:
I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - *Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Tony Harrison" wrote in message

...



Thanks for the quick reply Graham.


I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents,
and
certainly nothing in the footer stage. Obviously something with my set up
or
something.


I'll step it through the debugger and see if I can see why mine is not
working.


BTW I went with option 2 - get a macro to do the hard work.


tony


"Graham Mayor" wrote:


It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates the
field if already present.


Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
* * For Each ofooter In oSection.Footers
* * * * Set oRng = ofooter.Range
* * * * With oRng
* * * * * * For Each oFld In oRng.Fields
* * * * * * * * If oFld.Type = wdFieldFileName Then
* * * * * * * * * * oFld.Update
* * * * * * * * * * Exit Sub
* * * * * * * * End If
* * * * * * Next oFld
* * * * * * If Len(oRng) 1 Then
* * * * * * * * .InsertAfter vbCr
* * * * * * End If
* * * * * * .Start = ofooter.Range.End
* * * * * * .End = ofooter.Range.End
* * * * * * .Fields.Add oRng, wdFieldFileName, "\p", False
* * * * * * .ParagraphFormat.Alignment = wdAlignParagraphRight
* * * * * * .Font.Size = 8
* * * * * * .Fields.Update
* * * * End With
* * Next ofooter
Next oSection
End Sub


http://www.gmayor.com/installing_macro.htm


You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -http://gregmaxey.mvps.org/Customize_Ribbon.htm


--

Graham Mayor - *Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.


In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.


In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is when
the
user just opens Word that the footer already contains the footer.


I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).


Any help is gratefully received

  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default Word 2007 - put footer onto every new document when Word start

Note that adding the macro to the template won't affect already
existing documents based on that template, but only new documents
created from it.

On Jun 1, 1:47*am, "Graham Mayor" wrote:
I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - *Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Tony Harrison" wrote in message

...



Thanks for the quick reply Graham.


I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents,
and
certainly nothing in the footer stage. Obviously something with my set up
or
something.


I'll step it through the debugger and see if I can see why mine is not
working.


BTW I went with option 2 - get a macro to do the hard work.


tony


"Graham Mayor" wrote:


It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates the
field if already present.


Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
* * For Each ofooter In oSection.Footers
* * * * Set oRng = ofooter.Range
* * * * With oRng
* * * * * * For Each oFld In oRng.Fields
* * * * * * * * If oFld.Type = wdFieldFileName Then
* * * * * * * * * * oFld.Update
* * * * * * * * * * Exit Sub
* * * * * * * * End If
* * * * * * Next oFld
* * * * * * If Len(oRng) 1 Then
* * * * * * * * .InsertAfter vbCr
* * * * * * End If
* * * * * * .Start = ofooter.Range.End
* * * * * * .End = ofooter.Range.End
* * * * * * .Fields.Add oRng, wdFieldFileName, "\p", False
* * * * * * .ParagraphFormat.Alignment = wdAlignParagraphRight
* * * * * * .Font.Size = 8
* * * * * * .Fields.Update
* * * * End With
* * Next ofooter
Next oSection
End Sub


http://www.gmayor.com/installing_macro.htm


You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -http://gregmaxey.mvps.org/Customize_Ribbon.htm


--

Graham Mayor - *Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.


In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.


In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is when
the
user just opens Word that the footer already contains the footer.


I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).


Any help is gratefully received

  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Harrison Tony Harrison is offline
external usenet poster
 
Posts: 8
Default Word 2007 - put footer onto every new document when Word start

That's the trick Graham - thanks. If I open (to view) the footer the code is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents,
and
certainly nothing in the footer stage. Obviously something with my set up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received


.



.



  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Harrison Tony Harrison is offline
external usenet poster
 
Posts: 8
Default Word 2007 - put footer onto every new document when Word start


That's the trick Graham - thanks. If I open (to view) the footer the code is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running your
macro simply saves the document. Nothing appears in word 2007 documents,
and
certainly nothing in the footer stage. Obviously something with my set up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field does
not update automatically and the document will not have a filename until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it - http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to copy
files
into locations, etc).

Any help is gratefully received


.



.

  #12   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word start

Does it show in print preview?

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
That's the trick Graham - thanks. If I open (to view) the footer the code
is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and
puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running
your
macro simply saves the document. Nothing appears in word 2007
documents,
and
certainly nothing in the footer stage. Obviously something with my set
up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field
does
not update automatically and the document will not have a filename
until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates
the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -
http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had
the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is
when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to
copy
files
into locations, etc).

Any help is gratefully received


.



.



  #13   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word start


Does it show in print preview?

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
That's the trick Graham - thanks. If I open (to view) the footer the code
is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and
puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running
your
macro simply saves the document. Nothing appears in word 2007
documents,
and
certainly nothing in the footer stage. Obviously something with my set
up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field
does
not update automatically and the document will not have a filename
until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates
the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -
http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had
the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is
when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to
copy
files
into locations, etc).

Any help is gratefully received


.



.



  #14   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Harrison Tony Harrison is offline
external usenet poster
 
Posts: 8
Default Word 2007 - put footer onto every new document when Word start

Yes it does. Just not in my default view which is Print Layout.

"Graham Mayor" wrote:

Does it show in print preview?

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
That's the trick Graham - thanks. If I open (to view) the footer the code
is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and
puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running
your
macro simply saves the document. Nothing appears in word 2007
documents,
and
certainly nothing in the footer stage. Obviously something with my set
up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field
does
not update automatically and the document will not have a filename
until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates
the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -
http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had
the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is
when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to
copy
files
into locations, etc).

Any help is gratefully received


.



.



.

  #15   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Harrison Tony Harrison is offline
external usenet poster
 
Posts: 8
Default Word 2007 - put footer onto every new document when Word start


Yes it does. Just not in my default view which is Print Layout.

"Graham Mayor" wrote:

Does it show in print preview?

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
That's the trick Graham - thanks. If I open (to view) the footer the code
is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document and
puts
the saved name and path in the footer in 8 point font. Do you have enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me, running
your
macro simply saves the document. Nothing appears in word 2007
documents,
and
certainly nothing in the footer stage. Obviously something with my set
up
or
something.

I'll step it through the debugger and see if I can see why mine is not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For a
start
it prevents you from creating labels. Furthermore the filename field
does
not update automatically and the document will not have a filename
until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just updates
the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -
http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had
the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is
when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to
copy
files
into locations, etc).

Any help is gratefully received


.



.



.



  #16   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word start

In that case it is a display issue not attributable to the macro. I am not
sure what to suggest to resolve that.

--

Graham Mayor - Word MVP

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




"Tony Harrison" wrote in message
...

Yes it does. Just not in my default view which is Print Layout.

"Graham Mayor" wrote:

Does it show in print preview?

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
That's the trick Graham - thanks. If I open (to view) the footer the
code
is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document
and
puts
the saved name and path in the footer in 8 point font. Do you have
enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me,
running
your
macro simply saves the document. Nothing appears in word 2007
documents,
and
certainly nothing in the footer stage. Obviously something with my
set
up
or
something.

I'll step it through the debugger and see if I can see why mine is
not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For
a
start
it prevents you from creating labels. Furthermore the filename
field
does
not update automatically and the document will not have a filename
until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared
workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update
the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just
updates
the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -
http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had
the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is
when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to
copy
files
into locations, etc).

Any help is gratefully received


.



.



.



  #17   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 2007 - put footer onto every new document when Word start

In that case it is a display issue not attributable to the macro. I am not
sure what to suggest to resolve that.

--

Graham Mayor - Word MVP

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




"Tony Harrison" wrote in message
...

Yes it does. Just not in my default view which is Print Layout.

"Graham Mayor" wrote:

Does it show in print preview?

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in message
...
That's the trick Graham - thanks. If I open (to view) the footer the
code
is
there.

Thanks for the help.
tony

"Graham Mayor" wrote:

I have just copied the code from the reply to Word 2007 and apart from
showing the field code rather than the result it saves the document
and
puts
the saved name and path in the footer in 8 point font. Do you have
enough
footer space to insert it?

To fix the code display issue add the line
ActiveWindow.View.ShowFieldCodes = False
before End Sub.

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Thanks for the quick reply Graham.

I'm going to have to learn some commands here because for me,
running
your
macro simply saves the document. Nothing appears in word 2007
documents,
and
certainly nothing in the footer stage. Obviously something with my
set
up
or
something.

I'll step it through the debugger and see if I can see why mine is
not
working.

BTW I went with option 2 - get a macro to do the hard work.

tony

"Graham Mayor" wrote:

It is not a good idea to have a footer in the normal template. For
a
start
it prevents you from creating labels. Furthermore the filename
field
does
not update automatically and the document will not have a filename
until
the
document is saved. It would be better either to create a document
template
containing the footer, which you can distribute via a shared
workgroup
folder, or copy to the user's User Templates folder.
OR
My preferred method would be to use a macro to insert and update
the
filename field in the footer. The following macro will insert the
filename
and path in each footer of each section of the document after any
existing
footer content. It will only insert the field once, and just
updates
the
field if already present.

Sub InsertFilenameInFooter()
Dim oSection As Section
Dim ofooter As HeaderFooter
Dim oRng As Range
Dim oFld As Field
ActiveDocument.Save
For Each oSection In ActiveDocument.Sections
For Each ofooter In oSection.Footers
Set oRng = ofooter.Range
With oRng
For Each oFld In oRng.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
Exit Sub
End If
Next oFld
If Len(oRng) 1 Then
.InsertAfter vbCr
End If
.Start = ofooter.Range.End
.End = ofooter.Range.End
.Fields.Add oRng, wdFieldFileName, "\p", False
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Font.Size = 8
.Fields.Update
End With
Next ofooter
Next oSection
End Sub

http://www.gmayor.com/installing_macro.htm

You could supply this macro in an add-in with a modified ribbon
containing a
button command to run it -
http://gregmaxey.mvps.org/Customize_Ribbon.htm

--

Graham Mayor - Word MVP

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



"Tony Harrison" wrote in
message
...
Hi,
I've tried to find the solution to this, but to no avail.

In 2003 we modified the normal.dot so that every new document had
the
filename and path in the footer.

In 2007 I have modified the normal.dotm and if I click the Office
Button,
New, my templates, Normal then it works fine, but what I want is
when
the
user just opens Word that the footer already contains the footer.

I've got to roll this to 150 users so didn't want to modify each
machine,
but can make changes in Group Policy or via the login script (to
copy
files
into locations, etc).

Any help is gratefully received


.



.



.



Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a word document starts "configuring office Ultimate 2007" Morgoth Bauglir Microsoft Word Help 1 July 30th 08 09:17 AM
Word 2003 footer linked to previous starts renumbering pages [email protected] Page Layout 5 January 29th 08 06:01 PM
Word 2007 starts out with Document3. [email protected] Microsoft Word Help 0 February 13th 07 03:02 PM
Word 2007 starts out with Document3. [email protected] Microsoft Word Help 0 February 13th 07 03:02 PM
Word 2007 starts out with Document3. [email protected] Microsoft Word Help 0 February 13th 07 03:02 PM


All times are GMT +1. The time now is 09:06 AM.

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"