Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2024 by Barry MacDonnell. All Rights Reserved.

Page updated Jul 26, 2020

WordPerfect Tips
Main tips page | Browse more tips

How to create a Question-and-Answer style

For basic information about styles, and links to related pages on this site, see https://wptoolbox.com/tips/Styles.html.

You can easily set up a pair of styles to automatically format questions and answers, switching from the question to the answer to the next question, etc., when you press <Enter> at the end of each sentence or paragraph:

Q: Where did you go?
A: Nowhere.
Q: What did you do?
A: Nothing.

Here's how.

Set up new Question and Answer styles

[Note: This is a one-time procedure if you save the styles as described below.]

Step 1

In the current document (or custom template) ...

Click Format, Styles to bring up the Styles dialog.

Step 2

First, create the Question style.

•  Click the Create button to bring up the Styles Editor dialog.

•  Name it: In the "Style name" field, type "Question" (without quotes).

•  Describe it: In the "Description" field, type a simple description.

•  Ignore the "Enter key inserts style:" field. Leave it set to the current setting. We'll come back to it later.

•  Make sure the "Type" field is set to "Paragraph."

•  Optional: You can check the box, "Automatically update style...," if you think you may want to change the format of the style later, and have it automatically change throughout the document.
Step 3

•  While still in the Styles Editor, click in the "Contents" pane to place the cursor in it.

Some possible options to format the first part of the style (using the menu at the top of the Styles Editor dialog):

Start with a tab: Click Insert, Tab to insert a left tab code [Left Tab]. This will indent the first line of the paragraph one tab stop before the "Q:" is inserted.

Or - 

Start with a paragraph indent: Click Format, Paragraph, Indent to insert a hard left indent code [Hd Left Ind]. This will indent the entire paragraph one tab stop before the "Q:" is inserted, as in the examples above. However, for longer paragraphs, the paragraph's text will wrap underneath the paragraph instead of at the left margin.

Or -

Start with a hanging indent: Click Format, Paragraph, Hanging Indent to insert a "back tab" so that the "Q" is outside the left margin. The paragraph's text will wrap at the left margin.

Note: If WordPerfect also inserts a [Hd Left Ind] code to the left of the [HdBack Tab] code in the Contents pane, delete the [Hd Left Ind] code. You only need the [HdBack Tab] code.

•  Next, type in a "Q:" (without quotes).

Note:

Using a period (full stop) instead of a colon after the letter can automatically 
capitalize the first word of the following paragraph -- if QuickCorrect's Format-As-You-Go has been set to "Capitalize the next letter after end-of-sentence punctuation." (A colon is not seen by WordPerfect as the end of a sentence, but a period is seen as such.)

For a workaround if using a colon which also forces automatic capitalization of the first word on the following text, see Footnote 1 below.

•  Some possible options to format the last part of the style (using the menu at the top of the Styles Editor dialog:

Insert a hard left indent code with Format, Paragraph, Indent, since you probably will want the paragraph to wrap under the first character in the paragraph's text, rather than return to the left margin.

Or -

Insert a tab code with Insert, Tab so that the paragraph's text will wrap under the left margin instead of the "Q".

Note:

Such a hard left indent or tab code will have no effect if you have used the Hanging indent option above. Your paragraph text will already be at the left margin, "tabbed" inward by the hanging indent. You can leave the extra code after the "Q:" or delete it from the Contents pane.

•  The codes in the Contents window should look like this (assuming you inserted an optional leading and trailing hard left indent):

[Hd Left Ind]Q:[Hd Left Ind]

•  More options for this style:

You can format the "Q:" (font, relative size, bold, color, etc.) by selecting these characters and using the top toolbar options, or click on Format, Font.

If you want the paragraph style to automatically insert a hard return at the end of the paragraph (as a "blank line separator" -- which may be especially useful in the Answer style to put a blank line between pairs of Q&As):

▸ click the box "Show 'off codes'", and  
place the cursor to the right of the long [Codes to the left are ON...] code in the Contents pane, and
press the Enter key to insert a [HRt] code. 

You can insert Tabs (with Insert, Tab) or spaces instead of hard left indents.

•  Click OK to return to the Styles dialog.
Step 4

•  Repeat Steps 1 - 3 above steps to create a corresponding Answer style using an "A:" instead of a "Q:" in the Contents pane.

Step 5


Finally, you can "chain" the two styles together so that using one automatically leads to the other when you press the Enter key. [Tip: Skip this step if you want the styles to be separate -- i.e., independent of each other.]

•  Use the Edit button in the Styles dialog to open the Styles Editor so you can edit the new Question style you just created.

•  In the "Enter key inserts style" drop list, choose the Answer style to "chain" to whenever you press the Enter key after typing your question.

•  Click OK to return to the Styles dialog.

•  Use the Edit button in the Styles dialog again to edit the new Answer style, chaining back to the Question style.

•  Click OK to return to the Styles dialog.

Step 6

•  Optional - save the styles:

If you want to save these two new styles to your default template (probably a good idea if you think you'll need the styles again when you create new documents), click Options, Copy in the Styles dialog to copy the style to the default template.

Tip: You can always retrieve such custom styles in various ways into any document or template, as described in Custom Styles.

Step 7

Click Close to exit from the Styles dialog and return to your document.

Important 

Using the above method these custom styles were created only in the current document being edited. Unless you save them to the default (or other) template, or you later retrieve them from that document
, they will only be available in the document where they were created. See Tips below.

Use the new Q&A styles

Now, whenever you need a Question-and-Answer format -

[1]  Choose the Question style from the Text property bar's Select Style drop list, and type your question.

[2]  When you press the Enter key, you can type the answer.

[3]  Press the Enter key again, and you can type the next question, etc.

When you are done, stop the styles as described in the next section below.

Tips

☼  If you need multiple, separate paragraphs inside either the Question or Answer blocks, use <Ctrl+Shft+L> to insert a Line Break instead of using <Enter> for a hard return. Remember, inside the Question and Answer style blocks the <Enter> key will end the current paragraph style and begin (chain to) a new paragraph using the opposite style. To insert the equivalent of hard returns inside either one of the chained Q&A blocks, use one or more Line Breaks to separate the paragraphs.

☼  See also the Tips section below.

When you are done using the Q&A style

Either

select <None> from the Select Style drop list on the Text property bar;

or

press <Enter> to chain to the next block, then <Backspace> to delete the [Para Style][Style] codes to return to your previous format.

Tips

☼  As noted above, these new custom styles were created in the current document only (or in a custom template if you were editing one). If you want to save the new styles to your default template (probably a good idea if you think you'll need the styles again when you create new documents), when you are in the Styles dialog (Format, Styles) click on Options, Copy to copy the chosen style to the default template.

☼  You can always retrieve such custom styles in various ways into any document or template, as described in Custom Styles.

☼  You can use a leading underscore ("_") in the style names to force them to appear at the top of the Style list. You can edit the styles any time to do this.

☼  If you want to number the questions and answers (e.g., Question 1 ... Answer 1) you can set up styles with counters (which do the actual numbering for you). See this page, where you can simply change the name of the items to "Question" and "Answer."

☼  You can use a simple macro to start the Q&A styles. It should have this single command in it (assuming "Question" is the name you gave the style):

StyleOn("Question")

[See here for how to create a macro with this command. For easy access to the macro after you create it, see here. (For example, you could assign the macro to the Alt+Q key.)]



Footnote 1

As noted, using a period (full stop) instead of a colon after the letter (Q or A) can automatically capitalize the first word of the following paragraph -- if QuickCorrect's Format-As-You-Go has been set to "Capitalize the next letter after end-of-sentence punctuation."

A colon is not seen by WordPerfect as the end of a sentence, but a period is seen as such.

Hence, in the Styles Editor's contents pane for both Question and Answer styles, you can insert a period (full-stop) immediately after the colon, then add a white color immediately before the period and a black color immediately after the period (with Format, Font, Color on the Styles Editor menu). This makes the period "invisible" when printed
(of course, this implies that the paper is white and the ink color is black).

The Content pane of the style would then have 3 text characters (a Q or A, a colon, and a period) and 3 format codes, and it should look like this (when you pass your cursor over the codes):

Q:[Color: White].[Color: Black][Hd Left Ind]

Of course, if you just use a period in the first place (and no colon), you will not need this workaround.