Hi all,

I'am trying to insert WMF file in the word 2000 through code.
If there are more then 2 pages in the document it gives me error and
the autoshape property gets
lost of the WMF file.This WMF file can be inserted through insert
picture-> from file option.
when you do this manually the WMF gets inserted as autosahpe or else it
get inserted as picture.
The error which i get is as follows:-
Microsoft Visual Basic
---------------------------
Run-time error '-2147467259 (80004005)':

Can't move focus to the control because it is invisible, not enabled,
or of a type that does not accept the focus.
---------------------------
OK Help

Please let me know solution for this.
Thanks in advance.
-Sajin

Re: Insert WMF file in the word document by Jezebel

Jezebel
Mon May 29 08:25:30 CDT 2006

You'll need to post the code if you want help finding the bug. The error
value on its own doesn't help much.



"sajin" <sajin@iprlab.com> wrote in message
news:1148907555.191956.125280@j55g2000cwa.googlegroups.com...
> Hi all,
>
> I'am trying to insert WMF file in the word 2000 through code.
> If there are more then 2 pages in the document it gives me error and
> the autoshape property gets
> lost of the WMF file.This WMF file can be inserted through insert
> picture-> from file option.
> when you do this manually the WMF gets inserted as autosahpe or else it
> get inserted as picture.
> The error which i get is as follows:-
> Microsoft Visual Basic
> ---------------------------
> Run-time error '-2147467259 (80004005)':
>
> Can't move focus to the control because it is invisible, not enabled,
> or of a type that does not accept the focus.
> ---------------------------
> OK Help
>
> Please let me know solution for this.
> Thanks in advance.
> -Sajin
>



Re: Insert WMF file in the word document by sajin

sajin
Mon May 29 09:16:45 CDT 2006

Here is my code


ActiveDocument.Shapes.AddPicture Anchor:=Selection.Range, FileName:= _
"C:\Program Files\Common Files\Microsoft
Shared\Clipart\autoshap\bd18194_.wmf" _
, LinkToFile:=False, SaveWithDocument:=True