Skip to Content
0
Former Member
Sep 04, 2006 at 11:29 AM

Call MS Word File in BSP with OLE

167 Views

Hello,

i try to open/call a word document via button in my BSP.

I have written a programm which do that if i call the prog in my workbencht.

When trying to call the prgramm in the BSP Eventhandler, the document won't get open.

Can you help me?

Thats the souce code of the programm

REPORT ZLC_OLE_TEST.

type-pools ole2.

DATA: word TYPE ole2_object,

document TYPE ole2_object,

formfield TYPE ole2_object.

CREATE OBJECT word 'WORD.APPLICATION'.

CALL METHOD OF word 'Documents' = document.

CALL METHOD OF document 'Open' = document

EXPORTING #1 = 'C:\Word\test.doc'.

SET PROPERTY OF word 'Visible' = 1.