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
Doug Robbins - Word MVP - 18 Jan 2006 19:35 GMT
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.

Signature
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
> I'm trying to pull only a portion of the document filename field, but I
> would
[quoted text clipped - 9 lines]
>
> ~Lori
Lori - 19 Jan 2006 14:58 GMT
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
> 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()
[quoted text clipped - 13 lines]
> >
> > ~Lori
Jonathan West - 19 Jan 2006 18:37 GMT
> 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.

Signature
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
Peter Jamieson - 19 Jan 2006 10:34 GMT
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
> I'm trying to pull only a portion of the document filename field, but I
> would
[quoted text clipped - 9 lines]
>
> ~Lori