Consulting

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

Thread: Check for end of sentence and add a full stop if missing

  1. #21
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    Do you mean an Em dash? That has a character code of 151

    If Not .Characters.Last.Previous Like "[.!?:;" & Chr(151) & "]" Then
    Greg

    Visit my website: http://gregmaxey.com

  2. #22
    VBAX Regular
    Joined
    Feb 2020
    Location
    Auckland, NZ
    Posts
    29
    Location
    Yes, em dash. Wasn't too sure about concatenating in that circumstance, so that helps too.

  3. #23
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You would need to test for any of:
    Hyphen - ASCII 45
    En-dash - ASCII 150
    Em-dash - ASCII 151
    Minus sign - ASCII 173
    all of which can be inserted explicitly into the string without the need for Chr or ChrW
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #24
    VBAX Regular
    Joined
    Feb 2020
    Location
    Auckland, NZ
    Posts
    29
    Location
    Fab, thanks. All these numbers can get confusing! ANSI, hex, Unicode ...

Posting Permissions

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