Insert WMF file in the word document

S

sajin

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
 
J

Jezebel

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

sajin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top