Hi, i "use" VB6 to open MS Word document and fill Forms.Image
controls.
The problem is that when i execute function below in VBA works,
but when i
execute this function in VB6 it i get this error:

Run-time error -2147418113 (8000ftfty):
Method Picture' oF object 'Ilmage' Failed

My code :

For Each sh In ActiveDocument.Shapes
If sh.OLEFormat.ClassType = "Forms.Image.1" Then
With sh.OLEFormat.object
.BackColor = wdColorWhite
.BackStyle = fmBackStyleTransparent
.AutoSize = False
.PictureAlignment = fmPictureAlignmentCenter
.PictureSizeMode = fmPictureSizeModeZoom
.Picture =LoadPicture("image path file")
End With
end if
next

----------------------------------------------
Posted with NewsLeecher v2.0 RC2
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------

Re: Problem loading picture in Forms.Image by Word

Word
Wed Sep 28 07:11:10 CDT 2005

G'day oulaup (oulaup@hotmail.com),

Need to define a Word object and use the function on it.

MyWordApp.LoadPicture...


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


oulaup reckoned:

>Hi, i "use" VB6 to open MS Word document and fill Forms.Image
>controls.
>The problem is that when i execute function below in VBA works,
>but when i
>execute this function in VB6 it i get this error:
>
>Run-time error -2147418113 (8000ftfty):
>Method Picture' oF object 'Ilmage' Failed
>
>My code :
>
>For Each sh In ActiveDocument.Shapes
> If sh.OLEFormat.ClassType = "Forms.Image.1" Then
> With sh.OLEFormat.object
> .BackColor = wdColorWhite
> .BackStyle = fmBackStyleTransparent
> .AutoSize = False
> .PictureAlignment = fmPictureAlignmentCenter
> .PictureSizeMode = fmPictureSizeModeZoom
> .Picture =LoadPicture("image path file")
> End With
> end if
>next
>
>----------------------------------------------
>Posted with NewsLeecher v2.0 RC2
> * Binary Usenet Leeching Made Easy
> * http://www.newsleecher.com/?usenet
>----------------------------------------------