• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 65
  • Last Modified:

Word Style Indents AND Adds Quotation Marks to Beginning and End of Text

Have a long document.  It's about 1:5 of quotes:explication.

Have a word style for the quotes which indents them.  

For the explication I leave them unindented.  

So, it looks like

     The coin I pulled from the bag is a penny. That coin is a penny. A third coin from the bag is a penny. Therefore, all the coins in the bag are pennies.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Can easily indent the quotes with a Style, leaving the explications under Normal, unindented.  Is there any way to ALSO add applying quotation marks to the style?  So that, as I'm going through the paragraphs and applying the style to quotes, they not only get indented, but quotation marks are also added at the beginning and end of each styled paragraph?

So, it would look like:

     "The coin I pulled from the bag is a penny. That coin is a penny. A third coin from the bag is a penny. Therefore, all the coins in the bag are pennies."

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Thanks!

OT
0
oaktrees
Asked:
oaktrees
1 Solution
 
JohnBusiness Consultant (Owner)Commented:
There is not a native change to a Word style that can add Quotation Marks.

You would have to make a Macro and adjust it to your requirements. The article below talks about a Macro to add Quotes after the fact (which is what you want).

https://word.tips.net/T000009_Adding_Quotes.html
0
 
oaktreesAuthor Commented:
I wonder if there is a way to achieve what I want via Macro.  So that the Macro BOTH applies quotes AND applies a Style called via the Macro?

Sincerely,

OT
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
I do not know about double quotes but I use single quote bullet
quote3.png
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Eric FletcherCommented:
Here's a simple recorded macro that will do what you want:

Sub setQuote()
'
' setQuote Macro
' Adds a quote mark to the beginning of the current ¶, then
' to the end, then sets it in the quote style before ending at
' the start of the next paragraph.
'
    Selection.MoveUp Unit:=wdParagraph, Count:=1
    Selection.TypeText Text:=ChrW(8220)  '-- typographical open quote character
    Selection.MoveDown Unit:=wdParagraph, Count:=1
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.TypeText Text:=ChrW(8221)  '-- typographical close quote character
    Selection.Style = ActiveDocument.Styles("quote")
    Selection.MoveDown Unit:=wdParagraph, Count:=1
End Sub

Open in new window

I used typographical quotes (“ and ”) for the beginning and end of the current paragraph so they will be used even if the "Straight quotes" with “smart quotes” options are turned off in Word Options > Proofing > AutoCorrect.

If you associate this macro with a keyboard shortcut or a button, you can invoke it anywhere within a paragraph to add the quotes and set the style.
0
 
oaktreesAuthor Commented:
Hi Eric!

WOW!  This looks cool.  I'm confused - will this add quotes AND set a style simultaneously?

Sincerely,

OT
0
 
Eric FletcherCommented:
Yes. The code is just a recording of manual actions: Ctrl-UpArrow brings the focus to the beginning of a paragraph; pressing Alt-0147 inserts a typographical open quote; Ctrl-DownArrow jumps to the start of the next paragraph; BackArrow moves to the end of the previous paragraph; Alt-0148 adds the closing typographical quote; the style is set; and the final Ctrl-DownArrow moves to the start of the next paragraph.

There are more sophisticated ways of doing this in VBA, but the recorder does a perfectly adequate job of automating fairly straightforward actions like this.
0
 
oaktreesAuthor Commented:
Hi Eric,

Wow!  I'm thinking this will be sort of the Bigfoot of macros - long discussed, rarely seen!  Looking forward to giving it a try.  Hope to find time to remember how to do Macros over the next few days.  I'd feel grateful if you could keep an eye on this question.  In case I can't get it to work.

Thanks again!

OT
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now