#1
|
|||
|
|||
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! |
#2
|
|||
|
|||
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 |
#3
|
||||
|
||||
Code:
Sub Demo() Selection.InsertAfter Right(Split(ActiveDocument.Name, ".doc")(0), 6) End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
_for me_ it would not be trivial!
Then, there is still the matter of updating it and trimming the file name extension. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 2013: Building Blocks / Quick Parts - Form Question | EGoetz | Word VBA | 2 | 12-05-2013 09:09 PM |
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 |