Have a look at this - should be easily modified to do what you want instead of pasting into Word…
For more information, see the wiki Searching the Forum for Answers section.