I.ve been trying to include the last node of the file name in the document itself. The tricky part is that the file’s extension — the .doc — must not appear. The “filename” command includes the extension, so, unless there’s a way to modify it, I can’t use it. Any ideas?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Generating a file name without its extension (Word 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Generating a file name without its extension (Word 2000)
- This topic has 8 replies, 6 voices, and was last updated 22 years, 11 months ago.
Viewing 2 reply threadsAuthorReplies-
WSggallo
AskWoody LoungerJune 22, 2002 at 8:53 pm #596440If you can use a macro to do the insertion, this will work:
Sub TestIt() MsgBox FileNameOnly(ActiveDocument.FullName) End Sub Function FileNameOnly(FullName As String) Dim fs As Object Set fs = CreateObject("Scripting.FileSystemObject") FileNameOnly = fs.GetBaseName(FullName) End Function
If you’re using a field {filename} I don’t think there’s a way to modify it.
-
WSjscher2000
AskWoody LoungerJune 23, 2002 at 12:35 am #596467Another macro-based solution that might be more invisible to your users and potentially easier to maintain would be to create a custom document property called BaseName. In your template, this would be set to something arbitrary like TBD. As part of the SaveAs process (intercept the SaveAs command using, for example, Sub FileSaveAs), you could set the property to the correct string. Where you normally would use the FileName field, you then could use:
{ DOCPROPERTY “BaseName” * MERGEFORMAT }
Of course, this assumes a lot of things about your environment…
-
WSJul
AskWoody LoungerJune 23, 2002 at 10:15 pm #596529Thanks for the help. But my folks are uneasy with macros. What I’ve managed to do is
Insert a FileName field where I need it to print ,
Save the Word file = the .doc
Close the file
In Explorer, rename the file, removing the extension
Open the file via Explorer
Update the field = .doc is gone.Macabre, I know
Current question is — what can happen to that file without it’s extension? It will be kept in a versioning software environment, where most folks will be able to read it via Acrobat PDF while select others will be able to access it for editing purposes.. -
WSjscher2000
AskWoody Lounger -
WSJul
AskWoody LoungerJune 29, 2002 at 3:41 pm #598046My test files open, directly into Word, from Explorer. There it has that generic “page with a flying window” icon. Once saved in Word, it retains its extensionless state, and opens from the list at the bottom of the File menu. Documentum, the versioning software, will also open it, but it’s given its own ”name” it our installation of that system. Not very pretty, I admit.
But I agree that “bucking the system” is not the better part of valor.
Gave me an idea. I’ll see if I can get something else to open it.
Thanks for your support.
-
WSbjoeng
AskWoody LoungerJuly 3, 2002 at 6:45 am #598709Hi,
I have had the same problem. I have overcome it by incorporating the following macro to insert the file name minus the extension and the dot (.):
Me.txtDocName = Left(ActiveDocument.FullName, Len(ActiveDocument.FullName) – 4)
Me.txtDocName is a textbox in a User Form and then this is inserted into the document using a bookmark.
This must of course be coded in a template.
Hope it can be of some help.
Regards
Bj
-
-
-
WSHoward Kaikow
AskWoody Lounger
-
-
-
Charles Kenyon
AskWoody LoungerJuly 2, 2002 at 6:08 pm #598525Here’s another idea, not necessarily a better, or even good idea…
Change the Windows settings for viewing files to hide the filename extensions for known file types. If you do this, the FILENAME field will give you the name without the extension.
I think this is a very bad idea but it may be your only option.
Another idea would be a procedure that is in your AutoNew, AutoOpen, and FileSave macros. It would create a document property ‘ShortName’ based on the file name. You would then use a { DOCPROPERTY ShortName } field. You’ve mentioned a problem with using macros so this may not be an option and even if it is, it will be some work.
Any chance of getting your powers that be to simply accept that Microsoft can’t figure out how to leave this particular DOS legacy behind?
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
MS Office 365 Home on MAC
by
MickIver
29 minutes ago -
search by picture an not all that’s cracked up to be (Awaiting moderation)
by
Dru Fuksa
2 hours, 7 minutes ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
9 hours, 13 minutes ago -
Flash Drive Eject Error for Still In Use
by
J9438
10 hours, 46 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
1 day, 4 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
1 day, 4 hours ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
7 hours, 45 minutes ago -
Migrate off MS365 to Apple Products
by
dmt_3904
8 hours, 33 minutes ago -
Login screen icon
by
CWBillow
3 hours, 43 minutes ago -
AI coming to everything
by
Susan Bradley
6 hours, 32 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
1 day, 19 hours ago -
No Screen TurnOff???
by
CWBillow
1 day, 20 hours ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
1 day, 20 hours ago -
InfoStealer Malware Data Breach Exposed 184 Million Logins and Passwords
by
Alex5723
2 days, 8 hours ago -
How well does your browser block trackers?
by
n0ads
1 day, 18 hours ago -
You can’t handle me
by
Susan Bradley
18 hours, 32 minutes ago -
Chrome Can Now Change Your Weak Passwords for You
by
Alex5723
1 day, 11 hours ago -
Microsoft: Over 394,000 Windows PCs infected by Lumma malware, affects Chrome..
by
Alex5723
2 days, 19 hours ago -
Signal vs Microsoft’s Recall ; By Default, Signal Doesn’t Recall
by
Alex5723
1 day, 23 hours ago -
Internet Archive : This is where all of The Internet is stored
by
Alex5723
2 days, 20 hours ago -
iPhone 7 Plus and the iPhone 8 on Vantage list
by
Alex5723
2 days, 20 hours ago -
Lumma malware takedown
by
EyesOnWindows
2 days, 8 hours ago -
“kill switches” found in Chinese made power inverters
by
Alex5723
3 days, 4 hours ago -
Windows 11 – InControl vs pausing Windows updates
by
Kathy Stevens
3 days, 4 hours ago -
Meet Gemini in Chrome
by
Alex5723
3 days, 8 hours ago -
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
3 days, 9 hours ago -
Trump signs Take It Down Act
by
Alex5723
3 days, 17 hours ago -
Do you have a maintenance window?
by
Susan Bradley
1 day, 21 hours ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
2 days, 19 hours ago -
Cox Communications and Charter Communications to merge
by
not so anon
3 days, 20 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.