urgenttttttttt/how to run embeded object in the word??

N

noor

how I can run embeded object in the word when I open the word document.
the en=mbeddedplease I need your help.
object is an execution file.
 
H

Helmut Weber

Hi,
how I can run embeded object in the word when I open the word document.
the en=mbeddedplease I need your help. object is an execution file.

like this:

Sub Autoopen()
ActiveDocument.InlineShapes(1).OLEFormat.Activate
SendKeys "r", True
End Sub

Place Autoopen in the document.

Whether sendkeys is required may depend on your version of windows,
on the program you are going to start, and on the security settings.
Tested with notepad.exe and explorer.exe.

I couldn't find another method to overcome security settings.

Sure, you have to know, which inlineshape's oleformat
you want to activate. Could be a shape as well.

You could also use:
ActiveDocument.InlineShapes(1).OLEFormat.DoVerb (wdOLEVerbPrimary)

HTH


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
N

noor

it works
thank u v much.

Helmut Weber said:
Hi,


like this:

Sub Autoopen()
ActiveDocument.InlineShapes(1).OLEFormat.Activate
SendKeys "r", True
End Sub

Place Autoopen in the document.

Whether sendkeys is required may depend on your version of windows,
on the program you are going to start, and on the security settings.
Tested with notepad.exe and explorer.exe.

I couldn't find another method to overcome security settings.

Sure, you have to know, which inlineshape's oleformat
you want to activate. Could be a shape as well.

You could also use:
ActiveDocument.InlineShapes(1).OLEFormat.DoVerb (wdOLEVerbPrimary)

HTH


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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