Ask Your Question

Macro for removing OLE Objects

asked 2017-09-26 11:06:35 +0200

SOLDIERz gravatar image

Hello everyone,

I'm new here and want to ask if it is possible to write a macro and remove all ole objects inside that document. Is there reference page to call ole objects inside a macro?

Greetings SOLDIERz

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-09-26 13:59:19 +0200

Lupp gravatar image

Such a routine is possible. I think it will have to look rather differentl in the parts concerning 'Writer' and 'Calc' respectively. OLE objects are basically shapes contained in a DrawPage. The property to be an OLE object will be contained in the SupportedServiceNames property of the respective element of the DrawPage.

Now a relevant difference: A 'Writer' document has exactly one DrawPage which can enumerate its elements. 'Calc' documents have one DrawPage per sheet. As far as I can see they cannot enumerate their elements. You need to access them by DP.GetByIndex()

You may have to do some studies concerning the API to achieve your goals.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-26 11:06:35 +0200

Seen: 209 times

Last updated: Sep 26 '17