Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Perfect 8
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00280133
Message ID:
00280284
Vues:
10
Try posting your code. You'll sometimes find it easiest to use a combination of DDE and macros launched through DDE. Here's a snippet from my WP8 DDE operations, FWIW:

FUNCTION WPDDE
* Uses Word Perfect Templates to create a Document
PARAMETERS Which
Which=UPPER(Which)

=DDESetOption("Safety", .F.)
* Is WP Running?
m.lnChannel=DDEInitiate("WPWin8_Macros","Commands")&& Open a channel
IF m.lnChannel<0
RUN \\LSH_1\SYS\APPS\CADD\Start_WP_NT.EXE WPWIN
WAIT WINDOW "Starting WordPerfect - Please run after Word Perfect starts" NOWAIT
m.lnChannel=DDEInitiate("WPWin8_Macros","Commands")&& Try again to open a channel
IF m.lnChannel<0 && Still not started?
WAIT WINDOW "Word Perfect must be running!"
RETURN
ENDIF
ENDIF

DO CASE
CASE Which='ENVELOPE' && Create an envelope
test=DDEExecute(m.lnChannel,'TemplateSelect("J:\progs\wpsuite8\template\dde\dde_env.wpt")')
=DDEReplace('[To Whom]', ALLTRIM(reps.contact))
=DDEReplace('[Company]', ALLTRIM(reps.name))
=DDEReplace('[Title]', 'Representative')
=DDEReplace('[Address1]', ALLTRIM(reps.address1))
=DDEReplace('[Address2]', IIF(EMPTY(reps.address2),TRIM(reps.city)+;
', '+TRIM(reps.state)+'. '+TRIM(reps.zip),TRIM(reps.address2)))
=DDEReplace('[City, State Zip]', IIF(EMPTY(reps.address2)," ",TRIM(reps.city)+;
', '+TRIM(reps.state)+'. '+TRIM(reps.zip)))
* test=DDEExecute(m.lnChannel,'MacroFilePlay("J:\progs\wpsuite8\macros\wpwin\_autofil.wcm")')
ENDCASE
test=DDETerminate(m.lnChannel) && Close the channel
*************************************************
FUNCTION DDEReplace
PARAMETERS SearchText, ReplaceText
* Call like this: =DDEReplace('[To Whom]', ALLTRIM(reps.name))
SearchText = ['SearchString (StrgToLookFor: "]+SearchText+[")']
ReplaceText= ['ReplaceString (RplcStrg: "]+ReplaceText+[")']
test=DDEExecute(m.lnChannel,'PosDocTop()')
test=DDEExecute(m.lnChannel, &SearchText)
test=DDEExecute(m.lnChannel, &ReplaceText)
test=DDEExecute(m.lnChannel,'ReplaceForward (SearchMode: Extended!)')
Return



>I am attempting to use DDE with WordPerfect 8. I am getting an error when attempting to open an existing WP document which is "cannot retrieve or open document. Too many edit windows open"
>
>This message is coming from Word Perfect. Any guidance, opinions, or guesses as to what is going on is appreciated
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform