-
Aug 16th, 2015, 09:52 AM
#1
Thread Starter
Addicted Member
[RESOLVED] WebBrowser Context Menu halts my program...
Using the following code:
Code:
CreateObject("WScript.Shell").SendKeys "+{F10}", True
to open the context menu after I've gotten the focus on a link on the page. Once that is done, my program simply stops. It's like popping up that context menu sends my program into a hidden loop, not allowing the rest of the code to perform. Any ideas?
-
Aug 16th, 2015, 09:59 AM
#2
Re: WebBrowser Context Menu halts my program...
Not sure why you are using scripting control vs VB's SendKeys. With VB (assuming scripting control also), that 2nd parameter of True tells VB to wait for the reply (synchronous). Try changing to False
-
Aug 16th, 2015, 10:07 AM
#3
Thread Starter
Addicted Member
Re: WebBrowser Context Menu halts my program...
The original SendKeys doesn't work in Windows 7. Using it gives a runtime error 70: "Permission denied".
Changing it to False does nothing.
-
Aug 16th, 2015, 10:51 AM
#4
Thread Starter
Addicted Member
Re: WebBrowser Context Menu halts my program...
I've also tried DoEvents to see if that will clear it, but it just sits there as before.
-
Aug 16th, 2015, 11:02 AM
#5
Re: WebBrowser Context Menu halts my program...
Well, you can always try the SendInput API. There are many examples on the web and likely in this forum.
-
Aug 16th, 2015, 11:06 AM
#6
Thread Starter
Addicted Member
Re: WebBrowser Context Menu halts my program...
Though this doesn't solve the original issue, I figured out how to obtain the information I needed without having to use the WebBrowser control's context menu.
Code:
WebBrowser1.Document.ActiveElement.OuterText
...gets the link's text that has the focus.
Code:
WebBrowser1.Document.ActiveElement.OuterHtml
...gets the actual link.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|