> DECLARE INTEGER GetDefaultPrinter IN winspool.drv; > STRING @ pszBuffer,; > INTEGER @ pcchBuffer > > DECLARE INTEGER SetDefaultPrinter IN winspool.drv; > STRING pszPrinter > > *--------------------------------------------------------------- > *-- Set Default Windows Printer to MODI > *--------------------------------------------------------------- > nBufsize = 250 > cPrinter = REPLICATE(Chr(0), nBufsize) > = GetDefaultPrinter(@cPrinter, @nBufsize) > cOldPrinter = SUBSTR(cPrinter, 1, AT(Chr(0),cPrinter)-1) > = SetDefaultPrinter("Microsoft Office Document Image Writer") > > *--------------------------------------------------------------- > *-- Set OpenInMODI reg value to 0 > *--------------------------------------------------------------- > oShell = CREATEOBJECT("wscript.shell") > nOldOpenInMODI = 0 > TRY > nOldOpenInMODI = oShell.RegRead("HKCU\Software\Microsoft\Office\12.0\MODI\MDI writer\OpenInMODI") > CATCH > ENDTRY > oShell.RegWrite("HKCU\Software\Microsoft\Office\12.0\MODI\MDI writer\OpenInMODI", 0, "REG_DWORD") > > *--------------------------------------------------------------- > *-- Save the SOA reports to the specified destionation folder > *--------------------------------------------------------------- > IF lPrintDet > SELECT csNonCovList1 > REPORT FORM 'Non_Det' TO FILE (cFileNameDet + cExt) > ENDIF > > IF lPrintSumm > SELECT csNonCovList2 > REPORT FORM 'Non_Summ' TO FILE (cFileNameSum + cExt) > ENDIF > > *--------------------------------------------------------------- > *-- Set OpenInMODI reg value back to what it initially was > *--------------------------------------------------------------- > oShell.RegWrite("HKCU\Software\Microsoft\Office\12.0\MODI\MDI writer\OpenInMODI", nOldOpenInMODI, "REG_DWORD") > > *--------------------------------------------------------------- > *-- Set Default Windows Printer back to what it initially was > *--------------------------------------------------------------- > = SetDefaultPrinter(cOldPrinter) >Let me add that you may not need to write to the registry.
PROCEDURE iConvertTIF2MDI oMoDI = Createobject('MODI.Document') oMoDI.Create("c:\yy.tif") ERASE c:\yy.mdi miFILE_FORMAT_MDI=4 oMoDI.SaveAs("c:\yy.mdi", miFILE_FORMAT_MDI) oMoDI.Close(.t.)Good Luck