when you buy the license you will also have the cd/dvd for the installation. What you can do is to save your documents that you created with the actual pirated Office and then uninstall the pirated version and install the licensed one.
Anyway to my knowledge Microsoft shouldn’t be able to see that you have the pirated copy of Office; more info can be found on the Microsoft site.
Once you have purchased the licensed software and uninstalled and reinstalled the software Microsoft pretty much won’t care about the fact that you used to have pirated software installed. Once the software is reinstalled any trace of the pirated copy will be over written by the legit copy.