#1   Report Post  
Posted to microsoft.public.word.docmanagement
WayneL WayneL is offline
external usenet poster
 
Posts: 3
Default Modify feilds

How can I mondify the FileName feild so that it just gives me the
filename without the extention, with say Left(FileName,8).
Is there someway of using VBA say NoExt = FileName, then say insert
that into a feild?

WayneL



  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Modify feilds

No - but you can insert the filename (or filename and path) without the
extension directly into the document with a vba eg

Sub InsertfNameAndPath()
Dim pPathname As String
With ActiveDocument
If Not .Saved Then
.Save
End If
pPathname = Left$(.FullName, (Len(.FullName) - 4))
End With
Selection.TypeText pPathname
End Sub

Sub InsertFnameOnly()
Dim pPathname As String
With ActiveDocument
If Not .Saved Then
.Save
End If
pPathname = Left$(.Name, (Len(.Name) - 4))
End With
Selection.TypeText pPathname
End Sub

--

Graham Mayor - Word MVP

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



WayneL wrote:
How can I mondify the FileName feild so that it just gives me the
filename without the extention, with say Left(FileName,8).
Is there someway of using VBA say NoExt = FileName, then say insert
that into a feild?

WayneL



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
Protected Word Document with Exception to Modify Print Margins? [email protected] Microsoft Word Help 1 October 31st 05 12:49 AM
How to modify a left margin showing a logo in the margin on every Simply Mark1 Microsoft Word Help 4 September 30th 05 12:00 PM
Do I need to download Word to modify a document that is locked? Michele L Rabideau Microsoft Word Help 2 August 10th 05 08:05 AM
Accessing the Modify Style dialogue Resource1 Microsoft Word Help 1 January 29th 05 07:51 AM
Better use of modify locking? Top Spin New Users 3 January 6th 05 03:44 PM


All times are GMT +1. The time now is 12:49 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"