本帖最后由 snddd2000 于 2012-2-17 10:39 编辑
 - (setq msw (vlax-get-object "Word.Application"))
- (if (equal nil msw)
- (progn
- ; Word is not running. Start it.
- (setq msw (vlax-create-object "Word.Application"))
- (vla-put-visible msw :vlax-true)
- )
- )
- (setq docs (vla-get-documents msw))
- (setq doc (vlax-invoke-method docs 'Add))
- (setq range (vlax-invoke-method doc 'Range))
- (setq font (vlax-get-property range 'font))
- (vlax-put-property range 'Start 0)
- (vlax-put-property range 'End 1)
- (vlax-put-property range 'Text "A")
- (vlax-put-property font 'Subscript 0)
- (setq range (vlax-invoke-method doc 'Range))
- (setq font (vlax-get-property range 'font))
- (vlax-put-property range 'Start 2)
- (vlax-put-property range 'End 3)
- (vlax-put-property range 'Text "1")
- (vlax-put-property font 'Subscript 1)
|