Windows ole word automatism / use JUNO
BLS
Killing_Zoe at web.de
Tue Nov 14 10:22:00 PST 2006
Hi Gregor,
Have a look at the dmd samples directory. dclient.d
As far as I can see your ruby sample is a typical late binding scenario.
D can do more, or, in other words D can do what C++ can do, but in a
readable way. Have a look at the JUNO tool chain at dsource.org ...
projects JUNO.
Björn // btw : dsource is not avail. at the moment.
Gregor Kopp schrieb:
> Hi guys !
>
> I'm fresh to D and really happy about the easy syntax compared to C++.
> I would like to do automation with winword on my job here.
>
> First of all, a little Ruby code, so that you can see what I mean:
>
> Code starts here:
>
> require "win32ole"
> @word = WIN32OLE.new('Word.Application') # initialize a new word
> # next line: create a new file with the given template
> @word.documents.add(File.expand_path("myownfiletemplate.dot"))
> # next line: show word, because it would be hidden!
> @word.Visible = 1
> # search for text
> @word.selection.find.text = "Text to Search"
> @word.selection.find.execute
> # after search (text will me marked) exchange "Text to Search" with
> # "Replaced by this Text"
> @word.selection.typetext "Replaced by this Text"
>
> Code ends here
>
>
>
> Das a similiar lib (like this win32ole lib from ruby) exist for the D
> language? I also tried to work with dfl it does have a module named
> dfl.wincom, but there is no usable documentation about it, and I really
> don't know if its the right module.
>
> Greets, Gregor
More information about the Digitalmars-d
mailing list