Use comtypes module instead of custom code to deal with com objects