Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2016, 10:27 AM
luk25 luk25 is offline Word - quick parts (only 6 last characters from FileName) Windows 7 64bit Word - quick parts (only 6 last characters from FileName) Office 2013
Novice
Word - quick parts (only 6 last characters from FileName)
 
Join Date: Mar 2016
Posts: 1
luk25 is on a distinguished road
Default Word - quick parts (only 6 last characters from FileName)

Hi,

I try to use quick parts for to insert only the last 6 characters from FileName in text.
It is possible? Available is only option is option with full FileName.


Maybe can you prompt me something? For this moment I do not use VBA in office.

Thanks for your advance!
Reply With Quote
  #2  
Old 03-21-2016, 02:03 PM
Charles Kenyon Charles Kenyon is online now 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,118
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
  #3  
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: 21,962
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
  #4  
Old 03-22-2016, 04:44 AM
Charles Kenyon Charles Kenyon is online now 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,118
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

_for me_ it would not be trivial!


Then, there is still the matter of updating it and trimming the file name extension.
Reply With Quote
Reply

Thread Tools
Display Modes


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 11:50 AM.


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