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, 10 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
-
Outdated Laptop
by
jdamkeene
1 hour, 6 minutes ago -
Updating Keepass2Android
by
CBFPD-Chief115
6 hours, 31 minutes ago -
Another big Microsoft layoff
by
Charlie
6 hours, 11 minutes ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
6 hours ago -
May 2025 updates are out
by
Susan Bradley
6 hours, 36 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
12 hours, 15 minutes ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
12 hours, 17 minutes ago -
Drivers suggested via Windows Update
by
Tex265
12 hours, 8 minutes ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
9 hours, 52 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
19 hours, 7 minutes ago -
Apple releases 18.5
by
Susan Bradley
13 hours, 32 minutes ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
20 hours, 33 minutes ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
21 hours, 11 minutes ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
4 hours, 27 minutes ago -
No HP software folders
by
fpefpe
1 day, 4 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
2 hours, 11 minutes ago -
Stay connected anywhere
by
Peter Deegan
1 day, 10 hours ago -
Copilot, under the table
by
Will Fastie
1 day, 1 hour ago -
The Windows experience
by
Will Fastie
1 day, 16 hours ago -
A tale of two operating systems
by
Susan Bradley
6 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
1 day, 21 hours ago -
Where’s the cache today?
by
Up2you2
2 days, 13 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
2 days, 5 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
1 day, 6 hours ago -
Blocking Search (on task bar) from going to web
by
HenryW
8 hours, 29 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
3 days, 6 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
3 days, 6 hours ago -
regarding april update and may update
by
heybengbeng
3 days, 8 hours ago -
MS Passkey
by
pmruzicka
2 days, 9 hours ago -
Can’t make Opera my default browser
by
bmeacham
3 days, 15 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.