Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2016, 02:03 PM
Charles Kenyon Charles Kenyon is offline Word - quick parts (only 6 last characters from FileName) Windows 8 Word - quick parts (only 6 last characters from FileName) Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,533
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Even using vba, this would not be a trivial thing.
The display of a filename is through a field.
That field will display the filename as it displays on the user's computer, so if the user does not display extensions in Windows (the default) you get:


This is My Filename

If the user displays extensions, they would see:
This is My Filename.dotx

There is no way, using fields, to parse this.

Using Fields in Microsoft Word
Automated Boilerplate Using Microsoft Word
Reply With Quote
  #2  
Old 03-21-2016, 04:53 PM
macropod's Avatar
macropod macropod is offline Word - quick parts (only 6 last characters from FileName) Windows 7 64bit Word - quick parts (only 6 last characters from FileName) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Charles Kenyon View Post
Even using vba, this would not be a trivial thing.
Code:
Sub Demo()
Selection.InsertAfter Right(Split(ActiveDocument.Name, ".doc")(0), 6)
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word - quick parts (only 6 last characters from FileName) Word Template losing quick parts Anto_bt Word 4 11-05-2015 10:21 PM
Using Quick Parts >> Ref >> Field (Third word changing font) sonny49 Word 1 01-07-2014 10:01 AM
Word - quick parts (only 6 last characters from FileName) Word 2013: Building Blocks / Quick Parts - Form Question EGoetz Word VBA 2 12-05-2013 09:09 PM
Word - quick parts (only 6 last characters from FileName) Cannot select single characters. Word selects paragraphs or parts of sentences. TMinnich Word 2 10-25-2013 09:38 AM
Word 2007 Quick Parts kateVanG Word 2 04-15-2009 07:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft