PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Danilo David on November 06, 2023, 01:49:36 AM

Title: DEF OBJECT WORD
Post by: Danilo David on November 06, 2023, 01:49:36 AM
Hello.

Anyone can know how to translate these lines of codes using DEF OBJECT WORD,%WINDX$+"Word.Application" ?
because i did a lot of searched in the manual but i dont find helpful things to do it correctly.
Thank you and God bless

16920 LET CHAN_DDE_EXP=HFN; OPEN (CHAN_DDE_EXP)%WINDX$+"[DDE]"+%DF1_OFFICE$+"WINWORD;"+%DF1_SDRIVE$+"DF1\CONT_DF1\MASTERS_EXPORT\"+"Testrapport_"+STP(EXP_DOSSIERNR$)+"_"+STP(EXP_CBNR$,2)+".doc" ! *NOMSG*
16930 LET DDE_FIND$="<<CB0700>>",DDE_INSERT$=STP(EXP_DO_OMS$); GOSUB DDE_REPLACE
16940 LET DDE_FIND$="<<CB0701>>",DDE_INSERT$=STP(EXP_DOSSIERNR$); GOSUB DDE_REPLACE

49190 DDE_REPLACE:
49200 IF LEN(DDE_INSERT$)=0 THEN LET DDE_INSERT$=" "; GOTO 49240
49210 FOR TEST=1 TO LEN(DDE_INSERT$)
49220 IF ASC(DDE_INSERT$(TEST,1))=34 THEN LET DDE_INSERT$(TEST,1)="'"
49230 NEXT TEST
49240 !
49250 WRITE RECORD (CHAN_DDE_EXP)"[StartOfDocument]"
49260 WRITE RECORD (CHAN_DDE_EXP)"[EditReplace .Find:="+QUO+DDE_FIND$+QUO+"]"
49270 WRITE RECORD (CHAN_DDE_EXP)"[Insert "+QUO+DDE_INSERT$+QUO+"]"
49280 RETURN
Title: Re: DEF OBJECT WORD
Post by: Susan Cryderman on November 06, 2023, 09:53:39 AM
Not sure if this will help - but in PxPlus 2017 we added a PxPlus Word Object to simplify interactions with Word.  It may make translating your existing code easier.

You should be able to see the documentation for this object at the link below:

https://manual.pvxplus.com/PXPLUS/PxPlus%20User%20Guide/External%20Components/PxPlus%20COM%20Support/Word%20Object.htm
Title: Re: DEF OBJECT WORD
Post by: Danilo David on November 07, 2023, 03:09:36 AM
is it working also in the lower version, like v9 ?
Thank you
Title: Re: DEF OBJECT WORD
Post by: Mike King on November 07, 2023, 08:48:22 AM
Version 9 is over ten years old and not supported.  Add to that DDE itself is not technology that Microsoft promotes anymore.

We would suggest you upgrade to a more recent/supported release.  This would allow you to use our interfaces to both Word and Excel.