Displaying an M-Dash w/VBA code

Posted on 2006-05-02
Last Modified: 2012-08-14
I need to be able to display an M-Dash instead of a normal hyphen in a word document.  I need to be able to put it in code so that when that particular string is being displayed, the m-dash will appear with it.

Question by:CapnCrnch
    LVL 44

    Accepted Solution

    Hi CapnCrnch,

    not sure but you could look at
    Selection.InsertSymbol CharacterNumber:=8212, Unicode:=True, Bias:=0
       (This happens to be the symbol for an "M-dash")

    hope this helps a bit

    Author Comment

    Thanks for the response.  I finally found an answer.  Inserting a chr(151) does the trick.
    LVL 44

    Expert Comment

    glad you found your answer and thanks for the grade ;)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now