If that was true then why is OpenOffice open sourced, aren't they afraid that Microsoft would steal code from OpenOffice the same as an Open Sourced Java?

No, because they already have monopoly power in the office suite market. They don't perceive OpenOffice to be a threat, at least not yet. And don't forget, Microsoft controls the Office file formats. If OpenOffice starts to become a threat, they just change the Word file format, and the Excel file format, and suddenly OpenOffice isn't much of a threat anymore.

On the other hand, they've perceived Java as a threat for quite some time. There's no technical reason why they couldn't have supported JNI, but they chose not to specifically to make MS Java programs incompatible with the Sun JVM. Have you seen how many Visual J++ books Microsoft Press released? They worked very hard to pollute Java.