Its easy to forget the dismal security quality of the products Microsoft shipped not too long ago, although I would argue that such quality was the industry norm. Everyone has improved the security—or perhaps I should say "securability"—of their products, but nobody has improved as much as Microsoft.
Its not too long ago that Microsoft finally abandoned the Win9x kernel, a platform that was completely non-securable and couldnt even be made stable for long periods of time. The versions of Microsoft Office from the 1990s suffered similar weaknesses of architecture that prevented those versions from being made secure.
It wasnt until Windows XP Service Pack 2 and Windows Server 2003 Service Pack 1 that the platforms were no longer easy to hack. Clearly there was no premium placed on finding overflows and other weaknesses in code at Microsoft until that point. Products also came with default configuration choices that were designed to showcase new features, but were terrible choices from a security standpoint. The most infamous of these was turning IIS on by default on Windows 2000 Server, which exposed all of those servers to Code Red and similar worms.
But if you run the current generation of products and have your head screwed on right about security, you are at least as secure as with Microsofts products as with competitive products. UAC, despite some reasonable criticism, is generally considered a big step forward by security experts. Overflows are much rarer (although not unheard of), and defaults generally are restrictive. Consider this chart for a comparison of architectural design to facilitate security.
And even though the company has begun to address it, Microsoft has one big problem that will take years to fix completely: the old Office file formats.
You might have noticed, over the last year or so, a succession of code execution vulnerabilities in Office file formats, many accompanied by zero-day attacks. Ive read research, from Kaspersky I believe, to indicate that there is an inexhaustible supply of these, and that a fundamental change to fix the problem would cause more compatibility trouble than its worth.