The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 DDE problems with MS-word
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Markus

Germany
29 Posts

Posted - 03/18/2004 :  03:44:39 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I encountered some problems during script based dde-commands.
I have lots of graphs in some projects and want to have an overview in a word-file. So my script loops through the graphs in the projects, copy them to clipboard and paste them in word. I use a german version of the MS-office-programs, so the commands from the origin- or labtalk-manual I had to translate in order to make them work: document1->Dokument1 or for excel sheet1->Tabelle1 or Z1S1 (Zeile, Spalte) instead of R1C1 (for row and column).

The problem I have: I can connect to excel but not to winword.

Heres my script within the "doc -e P"-loop through the graphs (winword is already started):
clip %H; #copy the current graph to clipboard
dde -c Winword|Dokument1 IDwinword; #connect to winword
dde -e IDwinword [Einfügen]; #execute the paste-command in word
dde -d IDWinword; #disconnect

This script fails, the "dde -l"command shows no connection. I assume that's the reason for the command-error of the "dde -e ..."command.

I tried a lot to figure out some translation or syntax-problems and the following lines work fine -simply replaced winword by excel and Dokument by Tabelle:
clip %H; #copy the current graph to clipboard
dde -c Excel|Tabelle1 IDExcel; #connect to excel
dde -e IDExcel [Einfügen]; #execute the paste-command
dde -d IDExcel; #disconnect

My conclusion: syntax and translation of the application-specific commands (paste ->Einfügen) correct. I tried different origin-versions (5.0/6.1/7.0) with my MSoffice97-products with minor differences concerning the format of the inserted graph in excel but in all versions the connection and therefor the transfer to word failed.

Where is the key for this different behaviour between word and excel and how can I transfer my plots to word?

Thanks for any help.
Markus

sammi.song

China
46 Posts

Posted - 03/19/2004 :  05:14:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi markus,

I am not sure if I have understanded your point of view.
It seems you want to paste the Graph to word by labtalk. This is Object Linking and Embedded (OLE) between Origin and winWord, not DDE. DDE command provides just the Dynamic Data Exchange.

Thanks,
Sammi
Go to Top of Page

greg

USA
1380 Posts

Posted - 03/19/2004 :  10:09:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Word is (apparently) a bit fussier than Excel when it comes to DDE. It doesn't seem to like a connection to 'Document1', even though that lists a valid topic (translate System and Topics as needed):

dde -c winword|System IDsys;
dde -r IDsys Topics;
dde -d IDsys;
type %Z;

This is true of other applications as well - not just Origin.

Maybe some Word gurus can shed some light on this?

Of course COM would be better and there is an example of using Word from Origin and there is an example in 7.5 that runs Excel and Word from Origin in ..\Samples\COM Client\ReportCreation.c



Edited by - greg on 03/19/2004 10:10:44 AM
Go to Top of Page

Markus

Germany
29 Posts

Posted - 03/23/2004 :  04:43:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Sammi and Greg,

I did not know the topic system, it works in german winword and indeed the topic Dokument1 is listed. Nevertheless the link to Dokument1 fails.
I do not (yet) have version 7.5, so I have to find a solution that works. As far as I remember I had one some years ago when I wrote those lines of script.

Markus

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000