Modify Filename Field

L

Lori

I'm trying to pull only a portion of the document filename field, but I would
like it to remain in Feild format so that it remains dynamic.

Basically we have a document managment system that assigns numbers
automatically. I would like to capture just the document number and version
which is placed into the wdFieldFileName information, not the entire
filename. This way if the User copies to a new document number, the number
doc number will be displayed dynamically.

~Lori
 
D

Doug Robbins - Word MVP

I doubt that you can have it "remain in Field format so that it remains
dynamic", as what you will have to do is use the Left(), Mid() or Right()
functions to get the part of the filename that you want.



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

Peter Jamieson

Just a thought, but can your document management system be configured so
that it puts the document number and version number into Document Properties
(either built-in or custom)? If so, all you need then is to use a {
DOCPROPERTY } field and possibly to update it if that isn't done
automatically.

Peter Jamieson
 
L

Lori

Doug~

See. I've tried that {Mid({FILENAME},7,6)} and when I toggle the field
codes the whole disappears and doesn't come back.

~Lori
 
J

Jonathan West

Lori said:
Doug~

See. I've tried that {Mid({FILENAME},7,6)} and when I toggle the field
codes the whole disappears and doesn't come back.

No. Mid, Left & Right are VBA functions. You can't include them in field
codes like that. You need to use a VBA macro to calculate the bit of the
filename you want, and either insert that into the document directly as
text, or place it into a document variable or custom document property, and
have a DOCVARIABLE or DOCPROPERTY field refer to it.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
Top