macros for formatting in Word

  elgar 13:15 28 Oct 04

I want to write a macro in MS Word to automatically insert quote marks around selected text, e.g. convert I know you are there to "I know you are there" with one click. Does anyone know how to do this?

  pj123 17:49 28 Oct 04

Don't need to use a macro. Set it up as Autotext and all you need do is type a short name and hit F3 and there it is.

  Peter 17:55 28 Oct 04


What about Find & Replace, i.e. Find I know you are there and Replace with "I know you are there". No need for a macro.


  Alan2 22:01 28 Oct 04

Unless elgar comes back to say otherwise, I think he wants to be able to select "any text" then hit a key to put the double quotes around.

So a macro would be an efficient way to go about it.

  elgar 09:34 19 Feb 05

Yeah, thanks

I forgot about this post but still searching for an answer. What I need is exactly that, I want to be able to automatically put the speech marks around any sentence I select.

  VoG II 09:53 19 Feb 05

Sub qt()

Selection.InsertAfter Text:=""""

Selection.InsertBefore Text:=""""

End Sub

  Simsy 10:01 19 Feb 05

add the following as a module;

Sub AddQuoteMarks()

Dim quotation As String

quotation = Selection.Text

Selection.TypeText (""" & quotation & """)

End Sub

I've done this at work using Word XP.

You have to select the text first, then run the Macro. There will probably be issues if more than 1 block of text is selected.

I hope this helps,



  Simsy 10:31 19 Feb 05

not only has VoG™ beaten me to it, he also has provided a more elegant solution!



  Simsy 10:43 19 Feb 05

that in fact mine doesn't seem to work anyway!!!




  Simsy 11:22 19 Feb 05

mine does work when slightly ammended. the last line should be;

Selection.TypeText Text:="""" & quotation & """"

I got the clue from the formatting in VoG™'s posting.



  elgar 12:50 19 Feb 05

Thank you, another minor irritant solved.

This thread is now locked and can not be replied to.

Sony Xperia XZ Premium review: Hands-on with the new 4K HDR phone with Motion Eye camera and Snapdr5…

1995-2015: How technology has changed the world in 20 years

Best laptop for design and art 2017: we test Apple, Dell, HP, Lenovo and Microsoft's best models…

CarPlay tips & troubleshooting guide: CarPlay tips & troubleshooting guide: Get the most from…