03-24-2006 2:55 PM
Dear fellow developers,
my ABAP keyword documentation tells me that I can use
the EXPORTING parameter of CALL METHOD OF only for
enumerated parameters using #1 = value1 #2 = value2
and so on.
I'm trying to call up the "Execute" - method of the
MS WORD-class "Find", which uses a lot of optional
named parameters. Does anybody know how I can call
a method like that.
thanks in advance for your help
Andreas
03-24-2006 9:46 PM
Hi,
Hope this will help you....
the Execute Method of Object is called this way
WORD.FIND.EXECUTE with parameters [FindText], [MatchCase], [MatchWholeWord], [MatchWildcards], [MatchSoundsLike], [MatchAllWordForms], [Forward], [Wrap],etc
in ABAP to drill down to EXECUTE method
CREATE OBJECT GS_WORD 'WORD.APPLICATION' .
GET PROPERTY OF GS_WORD 'FIND' = GS_FIND.
CALL METHOD OF GS_FIND 'EXECUTE'
exporting
#1 = 'text' ( the text we are looking for)
#2 = for [MatchWholeWord], [MatchWildcards], [MatchSoundsLike], [MatchAllWordForms], [Forward], [Wrap],etc set a boolean value 'X'.
Regards,
Vara
03-27-2006 3:21 PM
Dear Vara,
can you make it work this way? Unfortunetaly I don't.
The parameters don't have fixed positions in the
parameter list and need to be called with the parameter
names, in VBA you have to call them like
WORD.FIND.EXECUTE FindText:="to be replaced", ReplaceWith:="hello", Replace:=wdReplaceAll.
As I understand you could as well change the order of
the parameters called like
WORD.FIND.EXECUTE ReplaceWith:="hello", Replace:=wdReplaceAll, FindText:="to be replaced",
as long as you provide the parameter values along with
their names to the function.
I think that's why using the #1, #2 - notation doesn't
work. I thought there might possibly be some kind of
trick like putting the entire parameter list into the first numbered parameter or something like that.
Thanks a lot
Andreas