Filename insert without extension using autotext

Hello,

I'm trying to use autotext to insert the filename without the extension. Also, I want the autotext to  update when the file is closed or opened. I've been able to get the autotext to update the way I want, but I can't figure out how to insert the filename without including the extension using autotext .
ironman05Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Joanne M. OrzechConnect With a Mentor Manager, Document Services CenterCommented:
Then maybe from the same article I linked to above:

"An easy way to insert the file name without the extension is to use a different field. For instance, you could use File | Properties to set the Title field to the document name (type it in manually) without the extension. You could then use the DOCPROPERTY field to recall that title and insert it in your document."

0
 
Joanne M. OrzechManager, Document Services CenterCommented:
There is a macro found here which appears to do what you need - although it isn't using autotext but rather, the file name itself:
http://word.tips.net/Pages/T000292_Inserting_a_File_Name_without_an_Extension.html


0
 
ironman05Author Commented:
Thanks JOrzech, but the macro used on the site does not do what I want. What I am trying to do is create a PO template that will take the filename, which will be named using the PO number, and update automatically where ever the filename was inserted via autotext.

The way I have it now:
I insert the filename using autotext and use two macros to update the filename inserted (when the file is closed or opened). However, the filename inserted contains the extension which I do not want.

if anyone has a better way of doing it, please let me know.

thank you
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Joanne M. OrzechManager, Document Services CenterCommented:
It sounds like you're doing an awful lot of unnecessary work...you are creating a Purchase Order.  Where is the name of each PO coming from?
0
 
ironman05Author Commented:
We have a document management system that will name each file by an 8 digit name, which will then be the PO number. Depending on what user is saving the file, the PO can be any random 8 digit number. The PO appears in several places in the doc so it would be easier to just have it autoupdate whenever the filename changes.

If you have a better method on achieving this, please inform me.
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
When inserted from your DMS... is the file name a field?  To verify, view footer, and press Alt F9.
0
 
ironman05Author Commented:
yes it is
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
Oh!  That's great then!  Wherever you want the file name to be included in the PO itself, just insert a REF field with the name of the field that DMS inserted.

For example, when you press Alt F9 and view the field code -- what did DMS name the field?  FILENAME?  If so, then just put in a REF field where you want the file number to show up.

See http://office.microsoft.com/en-us/word/HP051861391033.aspx
0
 
ironman05Author Commented:
The file extension still appears. I just want the number that file was named to. For example, if the DMS named the file 00101.doc, I want to just extract the 00101 from the filename and use it where ever the PO ID is needed.
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
Ah yes.... I apologize - I forgot about that (duh!) .... OK - I think you'll have to use a macro then.... let me look into it....
0
 
ironman05Author Commented:
I would like to make the whole thing automated. Meaning, if someone took the PO template and modified or saved the file it would take the new filename (without the extension) assigned to it and replace all the PO IDs that reference the old name. If I just change the TITLE field, the PO ID will not change when the file name changes unless I manually change the title field again.

fyi...I appreciate your help on this
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
Alright - I'm feeling defeated :( .... why would a document in a DMS ever change it's name?  I thought that was the whole point of the thing....Do you mean if someone creates a new document from the existing one?


0
 
ironman05Author Commented:
Yes that is what I mean, when a user creates a new document from an existing one. Users modifying the template will do a "save as", which the DMS will save appropriately.

I read those too, but I would have to run the macro each time rather than have it update automatically.
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
I'm sorry - I know of no way to do this easily - and from what I can see, even my other MVP friends have not figured out a way to do this ....

The easiest way I guess is to turn off file extensions in Windows Explorer... then you won't have to worry about getting rid of the file extension.
0
 
ironman05Author Commented:
No need to be sorry, I appreciate the help. I'm not finding a clear way to do it either.
I guess turning off file extensions would be the easiest. I'll keep looking and provide a solution if there is one
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
Thanks ironman... good luck then!  I would be REALLY interested to see a solution to this! :)
0
 
ironman05Author Commented:
Can't really find away to do what I want so I just change the folders not to display ext. and it works. Just a workareound really
0
 
davcosCommented:
Not sure if anyone found another way to do this, but I'm trying to do the same thing.  I have a formula that someone gave me for excel to accomplish this.  I wonder if something similar would work in word.  I don't think I could work with file extensions turned off.

It would be nice if there was a switch like the "/p" to hide the full path.  I'm wishing for "/-ext"

Below is my excel code...

=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1,SEARCH(".",CELL("filename"))-SEARCH("[",CELL("filename"))-1)
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
The only way we found was to turn off extensions in Windows Explorer.  I have, however, asked one of the Microsoft Office developers to give us an easier way to do this!!!



0
 
davcosCommented:
I thought that was an option in earlier versions of Word, when you inserted field in a header or footer?
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
I don't recall that feature in earlier versions...
0
All Courses

From novice to tech pro — start learning today.