run-time error

C

chubby

What causes a run-time error '4198' Command failed ?

I am inserting Win2k clipart with the following code:
Selection.InlineShapes.AddOLEObject ClassType:="MS_ClipArt_Gallery.5"

Cheers
 
H

Harold Kless[MSFT}

I tested your code snippet and don't get an error.
If you used selection.inlineShapes.addpicture... to you get the same error?

Harold Kless, MCSD
Support Professional
Microsoft Technical Support for Business Applications
(e-mail address removed)

--


This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
C

chubby

I get the error using Office XP SP2a with both WinXP SP1a & Win2k SP4.

What is the complete code snippet for
selection.inlineShapes.addpicture...
so that I may test this method.

Thanks
Josh
 
H

Harold Kless[MSFT}

This is a sample which includes all the parameter, but only Filename is
required.

Selection.InlineShapes.AddPicture FileName:=[fullpath and file name to be
inserted here], LinktoFile:=False, _ SaveWithDocument:=True,
Range:=Selection.Range

Harold Kless, MCSD
Support Professional
Microsoft Technical Support for Business Applications
(e-mail address removed)

--


This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
C

chubby

Yes, the InlineShapes.AddPicture method works fine.

Back to the original problem - when I run the code
Selection.InlineShapes.AddOLEObject ClassType:="MS_ClipArt_Gallery.5"
the Microsoft Clip Gallery 5.0 dialog appears and allows insertion of
clipart correctly, but a run-time error '4198' Command failed dialog appears
in the Word window.


When I do the same thing from the menu using:
Insert>Object>Microsoft Clip Gallery
everything works fine.

Any ideas?
 

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