vik1
11-06-2017, 03:14 AM
I wish to insert part of my filename in body of my document at one place.
The filenames can be,
36-gamon_rx-ric_la-630212--dd09162017-
or
36-stephen_ru-sam_greg-731234-286530-dd10172017-p
etc.
The pattern being, any english alphabet, followed by a hyphen, followed by any arabic number,
for eg, as above,
"a-9"
or
"g-7"
, wherein the arabic number followed by the letter is always 6 digits, but the number keeps
changing.
The numbers and alphabets will keep on changing, but the above pattern ( eg, "a-9" ) will
always remain.
I wish to truncate the filename, so only the 6-digit number is populated in the body of the
word document.
I have created a macro, using word > insert > quickparts, filename, but it inserts the entire filename. I am not able to truncate the filename to insert only the 6-digit number.
Any help would be greatly appreciated.
Thank you.
The filenames can be,
36-gamon_rx-ric_la-630212--dd09162017-
or
36-stephen_ru-sam_greg-731234-286530-dd10172017-p
etc.
The pattern being, any english alphabet, followed by a hyphen, followed by any arabic number,
for eg, as above,
"a-9"
or
"g-7"
, wherein the arabic number followed by the letter is always 6 digits, but the number keeps
changing.
The numbers and alphabets will keep on changing, but the above pattern ( eg, "a-9" ) will
always remain.
I wish to truncate the filename, so only the 6-digit number is populated in the body of the
word document.
I have created a macro, using word > insert > quickparts, filename, but it inserts the entire filename. I am not able to truncate the filename to insert only the 6-digit number.
Any help would be greatly appreciated.
Thank you.