Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macros (Word 2002)

    Hello everyone,

    Can anyone help me so that when this macro creates the quotes, the quotes are "curly" quotes and not "straight" quotes?

    Sub Quotes_Ad()
    ' Adds quotes to a single word
    ' Attached to ALT+K
    Selection.TypeText Text:=""""""
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    End Sub

    Thank you so very much. Happy New Year to everyone!

    Maria

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros (Word 2002)

    Hi Maria:
    How about<pre>Sub AddQuotes()
    '
    ' AddQuotes Macro
    ' Adds quotes around selected text
    ' Macro created 6/19/00 by Allen Wyatt
    ' copied from WordTips Gold 6/19/00
    '
    Dim BQuotes$
    Dim Equotes$
    Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    BQuotes$ = Chr$(147)
    Equotes$ = Chr$(148)
    Selection.InsertBefore BQuotes$
    Selection.InsertAfter Equotes$
    End Sub</pre>


    Cheers,

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros (Word 2002)

    Hi Phil,

    Thank you so very much for responding so fast.

    The macro works wonderfully, but like everything else, when I start using something I always find that what I asked originally was not quite what I needed. If I use only a word, then the macro works like I originally asked. However, I have been typing a bunch of words that include a comma or another type of symbol like a dash and in this scenario the macro only

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Macros (Word 2002)

    I'll butt in to say: what you get with Ctrl+Right Arrow or Ctrl+Left Arrow is what Word thinks of as "a word" in this context. It's very difficult to develop an "all-purpose" approach to this problem.

    When I first starting using Word, it didn't have the "Smart Quotes" feature and I wrote a macro I called "Curly Quotes" that worked the way certain codes worked in WordPerfect. That is, if nothing was selected, the macro inserted open and close curly quotes and placed the insertion point in between; if something was selected, it surrounded the selection with quotes and then positioned the insertion point after.

    (Much later...)

    I found the old template, but it was written in Word 2.0 (WordBasic) and will not convert. I think the last version of Word that could convert it would have been Word 97. Maybe someone can try it? (Note, it's named DOC but it's a DOT at heart.)
    Attached Files Attached Files

  5. #5
    Star Lounger
    Join Date
    Mar 2002
    Location
    North Carolina, USA
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros (Word 2002)

    It turns out you have to open it in Word 6, then in Word 97.

    Here is the Word 97 version -- I don't think the macro works anymore though.
    Attached Files Attached Files

  6. #6
    Star Lounger
    Join Date
    Mar 2002
    Location
    North Carolina, USA
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros (Word 2002)

    For what its worth, the intermediate step from Word 6.
    Attached Files Attached Files

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Macros (Word 2002)

    It sure is spooky looking at 10 year old code. Wow.

    In looking at the macro, it requires that the document have a bookmark (anywhere in it) named "CurlyQuotes" to insert the fancy characters. But it still should run with the regular " and ' characters without the bookmark. (I tested the single and double quote macros directly, but didn't try to bind them to the ' and Shift+' keys.)

Posting Permissions

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