From: cresimpl on
HI

My questions are:

1) How to use: tcom, optcl, msdoc, others ..., to paste to the MS Word
an image with the specified location (eg c: \ obrazek.jpg)?

2) Is there anyone who is able to translate the code snippet from the
MS Word macro, to tcl (tcom or other library of tcl)?

3) How can I use macros from MS Word from tcl with !Parameter! (tcom
or other...)?

Thank you, for your help,
cresimpl
From: cresimpl on
This is part of macro from MSWord macro tool, which paste image to
MSWord:

Selection.InlineShapes.AddPicture FileName:= _
"C:\Documents and Settings\user\Moje dokumenty\Moje obrazy
\bbb.jpg", _
LinkToFile:=False, SaveWithDocument:=True

How to translate it to tcl TCOM?
From: Goeran Hanke on
cresimpl schrieb:
> This is part of macro from MSWord macro tool, which paste image to
> MSWord:
>
> Selection.InlineShapes.AddPicture FileName:= _
> "C:\Documents and Settings\user\Moje dokumenty\Moje obrazy
> \bbb.jpg", _
> LinkToFile:=False, SaveWithDocument:=True
>
> How to translate it to tcl TCOM?


Hi

you may use the MS Word object catalogue inside the VBA editor to look
at the parameters of the Word methods and their classes.

The code snippet itself:

--------------------------------------------------------------------

proc testword {img file} {
set img [file nativename [file normalize $img]]
set file [file nativename [file normalize $file]]
package require tcom
set word [tcom::ref createobject Word.Application]
# $word Visible true
$word Visible false
set doc [[$word Documents] Add]
[[$word Selection ] InlineShapes ] AddPicture $img false true
$doc SaveAs $file
$word Quit
}

testword test.jpeg mydoc.doc
--------------------------------------------------------------------

G�ran
--
string map {DOT . AT @} gDOThankeATgmxDOTde