0
Is it possible to filter the filename of the Word file to present it inside the document? Let's say I have the following filename: Acme Co - Project XYZ - Code #123 - Year 15.docx
I need to get Acme Co
on the footer, Project XYZ
on the cover title, Code #123
and Year 15
on the cover as subtitle items. I tried the fieldcode { FILENAME }
but it only returns the entire filename and I didn't find any option regarding regex or filtering for that.
Wow, that's a lot of trouble. In fact, this isn't for anything large scale and/or business related, it's for my own purposes, I'm an university student and I have to do some works periodically for a bunch of different classes, hence I'd like to automate the document title/footer/etc according to the file name. Regarding Office, I always use Office Pro Plus 2016. – JChris – 2015-12-14T20:20:05.633
Just my opinion, but I think kill you would be better off decoupling these bits of information from the file name and avoid having to do VBA code. E.g., create an old-style custom document property for each item you want to insert, use { DOCPROPEr – None – 2015-12-14T20:40:17.783
Sorry, editing in a poor environment here and ran out of time: use the built-in custom document property dialog to maintain your property values, then use { DOCPROPERTY } fields to insert the values where you need them. For each new document, you will need to modify the values, then locate all the fields and update their results. There is an alternative if you have a SharePoint account and the privileges necessary to create your own SharePoint document library with custom columns. – None – 2015-12-14T20:51:52.583
Thanks, I already use that to update the variables within the document. What I was looking for is something like creating in advance a bunch of docx files named
Juan - Class XYZ - Work #XX - Issue #XX
, and put the information that I already know about them, likeWork #01, #02, ... #10
and the issue,Issue #01 or #02
. This way I'd have all docx files already set up in the respective folders, leaving me free to just open them and start writing without worry. But it seems it isn't possible, and if it's, it would be more work than it's worth :) – JChris – 2015-12-14T23:18:27.917If you can already write VBA, you may be able to write a routine that will generate the texts, generate the file name from that, create the file, create and populate the Custom Document Properties and update them. It's trying to take the file name and split it up using field codes that's not feasible. – None – 2015-12-15T10:11:38.273
Yeah, I see, many thanks. I'll try to have a look on VBA, after all, sooner or later I'll have to use it. – JChris – 2015-12-15T15:05:43.437