#include
#ifdef use_officeXp # import "C: / Program Files / Common files / microsoft shared / office10 / mso.dll" #import "c: // program files // circon files / microsoft shared / vba / vba6 / vbe6ext.olb" # import "c: / Program Files / Microsoft Office / Office10 / MSWORD.olb" rename ( "ExitWindows", "ExitWindowsEx") # import "c: / Program Files / Microsoft Office / Office10 / excel.exe" rename ( "DialogBox" , "DialogBoxxL") Rename ("RGB", "RBGXL") / Rename ("DocumentProperties", "DocumentProperties") Exclude ("IFONT", "iPicture") # Else # import "C: / Program Files / Microsoft Office / Office / mso9.dll "#import" C: / Program Files / Common Files / Microsoft Shared / VBA / VBA6 / VBE6EXT.OLB "NO_NAMESPACE #IMPORT" C: / Program Files / Microsoft Office / Office / Msword9.OLB "RENAME "EXITWINDOWS", "_ exitwindows") # Import "C: / Program Files / Microsoft Office / Office / Excel9.OLB" RENAME ("DialogBox", "DialogboxxL") Rename ("RGB", "RBGXL") / Rename (" DocumentProperties "," DocumentProperties ") Exclude (" ifont "," iPicture ") # endifint main (int Argc, char * argv []) {Variant Var Item; varItem.vt = VT_I4; varItem.intVal = 1; :: CoInitialize (NULL); CLSID clsid; #if 0 CLSIDFromProgID (L "Word.Application", & clsid); Word :: _ ApplicationPtr pApp; pApp.CreateInstance (clsid , NULL); pApp -> PutVisible (VARIANT_TRUE); pApp -> getDocuments () -> Add (); Word :: _ DocumentPtr pWordDocument = pApp-> GetActiveDocument (); Word :: SelectionPtr pSelection = pApp -> GetSelection (); Pselection -> Typetext ("Badguy"); # Endif # if 1 CLSIDFROMPROGID (L "