Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protected Word Document with Exception to Modify Print Margins? | Microsoft Word Help | |||
How to modify a left margin showing a logo in the margin on every | Microsoft Word Help | |||
Do I need to download Word to modify a document that is locked? | Microsoft Word Help | |||
Accessing the Modify Style dialogue | Microsoft Word Help | |||
Better use of modify locking? | New Users |