SA-DBA

Jul 9 2009   9:21PM GMT

Preventing MS Word from formatting your code…

Richard Evans Richard Evans Profile: Richard Evans

This is probably a problem that was solved years ago but I figured it out recently. Hopefully it helps someone!

The Problem

When I’m in Word and I’m creating or modifying documentation that involves code, Word wants to automatically replace certain characters with characters it thinks looks better.

Often times, I don’t notice it did that until I go to use the code. Here you’ll see the “smart quotes” ( ` ) that Word automatically replaced my straight quote ( ‘ ) with.


SQL> select job_id, job_name, job_owner, job_status
from mgmt_job
where job_status != 0
and job_name like ‘%LEVEL%0%’
order by job_name

It doesn’t look like much of difference, but it shows up in SSH as a period ( . ) and then errors.


SQL> select job_id, job_name, job_owner, job_status
from mgmt_job
where job_status != 0
and job_name like .%LEVEL%0%.
order by job_name
/
and job_name like .%LEVEL%0%.
*
ERROR at line 4:
ORA-00936: missing expression

The Fix

When you set options on the AutoFormat As You Type tab (Tools menu, AutoCorrect Options command), Word can automatically format text as you’re typing your document. For example, if you type a number followed by a period or hyphen, followed by a space or tab, followed by text, Word makes the text a numbered list.

When Word applies automatic formatting, you can use the AutoCorrect Options button to undo the action or change AutoFormat settings. Depending on the situation, the entire button may appear or the button may first appear as a small, blue box that changes to a button icon when you point to it.

I unchecked the first option, straight quotes vs. smart quotes as well as the hyphens and the bold/italic options.

 

 

If the automatic borders, tables or bullet lists annoy you there are options there to fix them as well ;-)

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: