Link to home
Start Free TrialLog in
Avatar of ankur3020
ankur3020

asked on

asking permission

when i am running the followinf vbs file it pop up message as attached.

Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text", "" 
objIE.Quit

I WANT THE CODE SHOULD RUN WITHOUT ANY POP/PERMISSION. WHAT CHANGES REQUIRED TO DO SO.
popup.jpeg
Avatar of si_shamil
si_shamil
Flag of Israel image

Probably, it is prohibited by IE's security option.
Avatar of ankur3020
ankur3020

ASKER

pls give vbs code to omit this
if i want to use notepad instead of word ,make changes required in following code.

' Set what you want to put in the clipboard '
strMessage = "Imagine that, it works!"

' Declare an object for the word application '
Set objWord = CreateObject("Word.Application")

' Using the object '
With objWord
   .Visible = False             ' Don't show word '
   .Documents.Add               ' Create a document '
   .Selection.TypeText strMessage   ' Put text into it '
   .Selection.WholeStory        ' Select everything in the doc '
   .Selection.Copy              ' Copy contents to clipboard '
   .Quit False                  ' Close Word, don't save '
End With

It is not possible to do it from notepad, because there is not application object for notepad.

I suggest you use a freeware utility called NIRCMD:
http://www.nirsoft.net/utils/nircmd.html

the you can use it to set the cliboard:
 
nircmd.exe clipboard set "Hello World!"
SOLUTION
Avatar of Michael_D
Michael_D
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
dear , i know in one of your experts answer he told me to close above permission. but when i asked him about the code to close that instead of manual way, i did not get response for long time. so i thought let me ask a fresh question.

anyway, i followed his idea and able to do it but again the question is still there. i want to enable "allow programmatic clipboard access" in scripting of internet security with vbs code.

pls help me to provide it.. can i do the same with registry dwrod key. ?
all three questions in the list I posted provide the answer to your question using registry settings or other way
but you ignored them and ask the same question 4th time ....
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial