(defun c:test (/ msw doc paragraphs pg range) (if (equal nil mswc-wd100Words) (vlax-import-type-library :tlb-filename "C:\\Program Files\\Microsoft Office\\OFFICE11\\msword.olb" :methods-prefix "mswm-" :properties-prefix "mswp-" :constants-prefix "mswc-" ) ) (setq msw (vlax-get-or-create-object "word.application")) (vla-put-visible msw :vlax-true) (if (/= nil msw) (progn (setq doc (mswm-add (vla-get-documents msw)) paragraphs (mswp-get-paragraphs doc) pg (mswp-get-last paragraphs) range (mswp-get-range pg) ) (mswp-put-Italic range 1) (mswp-put-underline range mswc-wdUnderlineSingle) (mswm-InsertAfter range "斜体字下划线\n" ) (setq pg (mswp-get-last paragraphs)) (setq range (mswp-get-range pg)) (mswp-put-Italic range 0) (mswp-put-underline range mswc-wdUnderlineNone) (mswm-InsertAfter range "正常字体\n\n" ) (vlax-invoke-method (vlax-get-property msw "ActiveDocument") "SaveAs" "c:\\1111.doc" ) (mswm-Quit msw) );_end of progn (alert "No Microsoft Word application found.") );_end of if ) 终于试验出来二者的接口,请问班主能否提供些有关Word类型库函数用法的介绍,有些函数不知道如何使用。 |