Show FILENAME without file format

Show FILENAME without file format

JJ_PL
Participant Participant
199 Views
2 Replies
Message 1 of 3

Show FILENAME without file format

JJ_PL
Participant
Participant

Hello guys,

 

I would like to ask for help to display FILENAME in general note but without file format.

 

JJ_PL_1-1747139097470.png

 

I do display it by showing standard iProperties : FILENAME general note...

 

I have tried to write short code to generate new property, but i don't know how to select FILENAME parameter

 

JJ_PL_2-1747139361380.png

I think the way I try to do it is good, but can go over this problem and I can't find soulution in google

 

Would be greatful for tips

 

Regards

 

JJ

 

0 Likes
Accepted solutions (1)
200 Views
2 Replies
Replies (2)
Message 2 of 3

CCarreiras
Mentor
Mentor
Accepted solution

Hi!

You can create a custom parameter to get the file name without extension, then add that parameter to the annotation.

 

' Get the full document file name (with extension)
Dim fullFileName As String
fullFileName = ThisDoc.FileName(True) ' True includes extension

' Remove the extension to get just the file name
Dim fileNameWithoutExtension As String
fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(fullFileName)

' Set the Part Number to match the file name (no extension)
iProperties.Value("Custom", "FNnExt") = fileNameWithoutExtension

or just:

iProperties.Value("Custom", "FNnEXT") = ThisDoc.FileName(False)
CCarreiras

EESignature

0 Likes
Message 3 of 3

JJ_PL
Participant
Participant

thank you very much!

 

Regards 

 

JJ

0 Likes