DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between Word basic and DIADEM script

I'm trying to program some things in Word via a DIAdem script. One thing I want to do is move to the end of the document. When I turn on the macro editor in Word and press End to move to the end of the document, the Word basic editor comes up with this

Selection.EndKey Unit:=wdStory

If I enter the above in my DIAdem script (adding Word. in front of it) DIAdem of course doesn't like the "Unit:=wdStory" part. When I execute

Word.Selection.EndKey

it only goes to the end of the line.

There are some other commands I want to do that also have qualifiers like this. How do you tell DIAdem script about the qualifier?

George
0 Kudos
Message 1 of 3
(3,527 Views)
I figured it out. In case anyone is interested the equivalent command in DIAdem for this command in Word Basic

Selection.EndKey Unit:=wdStory

is

Word.Selection.EndKey 6

6 is the value of wdStory. I suppose there's a way to include the constant definitions, but I don't know how.

George
0 Kudos
Message 2 of 3
(3,520 Views)
George,

Word (and Excel, Powerpoint) come with a large number of constants like the one you used. When you want to use more of them, I recommend to include the type library which comes with those products. DIAdem makes this very easy : Go to the menu in SCRIPT : "Script"=>"type library overview". From the dialog you select the product your are interested in e.g. "Microsoft Word 11.0 Object Library".
Then click the button "Clipboard". This generates a little code snipped. Goto to your script and insert from clipboard (ctrl+v). What you will see is something like this :

' Microsoft Word 11.0 Object Library
' D:\Programme\Microsoft Office\OFFICE11\MSWORD.OLB
Call AutEdTypeLibAdd("00020905-0000-0000-C000-000000000046", "8.3")

If you now add a line like "MsgBox("wdStory : "&wdStory)" you will teh result you expecct.

Andreas
0 Kudos
Message 3 of 3
(3,514 Views)