Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 26 of 26

Thread: Display filename without extension

  1. #21
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Agreed. It's also a technique that's been exploited by people wanting to distribute malicious files

    Seriously?

    Well then. I am completely, utterly with macropod on this - use underscores. ESPECIALLY if you raise the issue of multiple dots being malicious. Sheeesh. Really? I have been away too long. But then, I NEVER click open files from email. Ever. And when I was working, we locked users from doing it. They had to save files before opening them. So scanning was done at the front-end (incoming email) and at the (sort of) back end (when they saved files).

    I still think using dots in filenames is a bad bad idea. Or at least a very poor idea.

  2. #22
    VBAX Master
    Joined
    Feb 2011
    Posts
    1,480
    Location
    Unfortunately, it's not just the user that does this. Some DMS's have the ability to export large numbers of files, and the choice is to export the document using the document description (a name) or the document number.

    In one case you might get
    124453_5.docx (doc # 124453, version5)
    but in the other you might get
    Ltr. to client A regarding Mr. Smith's such and such proposal.docx

    Since the document "description" field in the DMS is a totally open text field, end-users will type whatever they want there. And they will naturally use periods sometimes, despite training/policies to try to avoid special characters in those fields.

    So, at the end of the day, you will still end up with scenarios where your macro may be dealing with erroneous periods not related to the actual doc extension. I absolutely agree with not creating systems which use periods, if at all possible. I think using an underscore instead is a good best practice.

  3. #23
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    A few code tweaks would prevent users including periods in filenames. I doubt anyone would be seriously out out by seeing:
    Ltr to client A regarding Mr Smith's such and such proposal.docx
    instead of:
    Ltr. to client A regarding Mr. Smith's such and such proposal.docx
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #24
    VBAX Master
    Joined
    Feb 2011
    Posts
    1,480
    Location
    Well, true... if you could capture all the various ways to input that info.

    But most DMS's have multiple ways to enter documents into the DMS (Save As from Word being only one of them... there's also drag n' drop from an email attachment, some kind of "Import File" function, etc), at which point you can input profile info and never have interacted with VBA at all.

    Of course, you can always write code to fix such things... but a minute of training can often supplement a month of coding for things like this. At the end of the day-- nothing is idiot proof.

    It's a really good point that malicious attacks tend to hide behind use of multiple periods in file names, so I add that info in the answer to "Why shouldn't I use periods in my document description?" rather than try to solve it in what would be a really heavy custom code foot print.

    However-- this discussion will probably have me on the phone for an enhancement request to Interwoven/Autonomy/HP/Filesite/Whatever-it's-called-these-days. I'd never thought of the malicious distribution issue before.

  5. #25
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    I really think - IMO - that it is an issue of best practices. And that being said, I think using dots in filenames is NOT a best practice. I also think overly extended file names themselves are not a best ptactice. If there is a serious requirement for very long names with some sort of separator between words, then there are alternatives - valid alternatives - to using dots. I fail to see there being any REAL need for using dots. And there is a decided negative to using dots. So....why use dots?

  6. #26
    VBAX Regular
    Joined
    Sep 2018
    Posts
    6
    Location
    Thank you. I used this too and it works perfectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •