Sure, you can do this for a style. I’ll set up the style with the name ‘Code’ by defining a quick style here.
After selecting the text and right-clicking, choose Styles and Save Selection as a New Quick Style…. When the Create New Style from Formatting box appears, enter the style name and then click on the Modify… button.
Here is where you can define the style further and also define whether or not you want to add this style to the Normal template. As for the spell check, click on Format at the bottom and select Language...
When the Language dialog box opens, click on the Do not check spelling or grammar box and click OK.
When you have completed your style specifications and close out of all dialog boxes, you can run a spell-check. This was the first error Word found on my document. Notice that it skipped all of the text marked with the Code style.
Hope this helps.