[OT] Re: Windows ole word automatism

Gregor Kopp gk at cutcopy.com
Wed Nov 15 00:16:01 PST 2006


Thank you all for the tipps ;)

I'll take a look at JUNO, when dsource is online again. Tried the last 
days to reach that site. But I think it will be back again soon.

Hehe, youre not the only Gregor *g*
But nevermind, I know lot's of people which don't draw distinctions 
between Georg and Gregor and THAT is annoying for me. But only a little 
bit ;)

Sorry my english, it isn't my natural language and thank you for your 
friendly acceptance.


Gregor Richards schrieb:
> Gregor Kopp wrote:
> 
>> 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
> 
> 
> Oh no, another Gregor!  Oh, the confusion that will ensue!
> 
>  - Gregor Richards



More information about the Digitalmars-d mailing list