在 BCB 中使用 OLE Automation 控制 MS WORD, 其語法不甚美觀, 例如: Variant word; word = CreateOleObject( "Word.Application" ); word.OlePropertySet( "Visible", Variant(true) ); 而且, 使用 Variant 即表示使用晚連結. 另一個以控制 WORD 的方法是利用 Import Type Library 這項功能 (可在 IDE 主選單中找到) 將 Micorsoft Word 的 type library import 進來, 此法使用早連結, 且在速度上有較好的表現. 以下節錄自 Borland forums: -------------------------------------------------------------------- Also, I noticed that the BCB3 code that Alexis posted is using Variants, and thus, late binding (disp. interface). With BCB3 it is possible to import the Word type library and use early binding (dual interface), which is superior in terms of performance. The syntax is arguably a little better, too: WordApp->set_Visible( true ) ; I just converted a BCB1 program to BCB3. I re-coded an entire section to that used to Automate Word 97 using Variants. It now uses the type library and early-binding, and the speed increase was fantastic. It takes some time to study the type library header file and get a feel for how it works, but it's well worth it. --------------------------------------------------------------------