A federal judge in Texas has ordered Microsoft Corp. to stop selling some versions of its Word software in the U.S. within two months.

A federal judge in Texas has ordered Microsoft Corp. to stop selling some versions of its Word software in the U.S. within two months.

U.S. District Court Judge Leonard Davis was reaffirming his court’s May decision, which found Microsoft’s widely used word processing program infringes on a Canadian technology company’s patent. The dispute is over the way Word 2003 and Word 2007 encode and display information.

The judge makes exceptions for versions of Word that remove certain custom code before opening a file, leaving the door open for Microsoft to come up with a technical workaround to the injunction.

The judge also has ordered Microsoft to pay $290 million to Toronto-based i4i LLP.

Microsoft says it will appeal.