insert object display as icon

D

DJK

Is there code to insert an object and change to "Create from file" and then
click display as Icon - then let user choose their own object?
I tried
Dialogs(wdDialogInsertObject).Show (this opened the insert object box)
objNew.OLEFormat.DisplayAsIcon = True (got error)
 
J

Jay Freedman

It can be done, but it isn't that simple, partly because you're going
about it wrong and partly because Microsoft never finished VBA support
for built-in dialogs.

This works:

Dim dlg As Dialog
Set dlg = Dialogs(wdDialogInsertObject)
On Error Resume Next
SendKeys "%f%a"
dlg.Show

SendKeys can be touchy, so sometimes this might not work. :-(

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
D

DJK

This worked very well - THANKS!
--
DJK


Jay Freedman said:
It can be done, but it isn't that simple, partly because you're going
about it wrong and partly because Microsoft never finished VBA support
for built-in dialogs.

This works:

Dim dlg As Dialog
Set dlg = Dialogs(wdDialogInsertObject)
On Error Resume Next
SendKeys "%f%a"
dlg.Show

SendKeys can be touchy, so sometimes this might not work. :-(

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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