Display file name without file extension

Started by djmyers, September 20, 2013, 02:09:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

djmyers

I am trying to create a drawing title shape that shows the drawing file name and the current sheet.  This way it will automatically update when I copy it to a new sheet.

In the text fields section I currently have:

FILENAME()&":"&" "&PAGENAME()

They only problem I have is that the file name includes the file extension.  Is there any way that I can show all characters before the file extension (just need to remove the last 4 characters, .vsd).

Thanks

Surrogate

QuoteLEFT(FILENAME(),LEN(FILENAME())-4)&":"&" "&PAGENAME()

AndyW

Don't forget for later versions of Visio, the file extensions can be VSDX etc.
Live life with an open mind


RNA_Polymerase

@Surrogate
Would you know how to do the same thing in an older version of Visio, such as 2002 or 2003? I was wrestling with similar commands last night and it does not seem to support many string manipulations like LEFT or REPLACE or even the function LEN.

I was able to produce the result in VBA code using 'REPLACE(Visio.ActiveDocument.Name, ".vsd", "")', but was not able to get Visio to use this code to change the text in the Shape in an elegant and repeatable way (do to code restrictions).

I was hoping to find a way to do this task within the ShapeSheet formula, but it seems to be rather antiquated in version that old.