473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with IE Browser Menu in VB (Question for experts)

Hi

I have been searching all the newsgroups and MSDN but cant seem to
find how to perform a "simple" task.

I basically want to achieve the following:

Given a URL, I navigate to the URL, position to a frame within the Web
page, copy the contents and paste or save as file the copied contents.

I dont know the name of the frame in the frame-definitions, so to get
around this, I am positioning the Mouse manually to that frame

I have tried using SendKeys to send Control-A and Control-C, but these
dont seem to work.

I am now trying to activate the Right-click and then Select "View
source" or use "select All" and then "copy" and then "Paste".

I have tried variations of "view source:" such as

WebBrowser1.Navigate "view-source:" & WebBrowser1.LocationURL

but these dont display the correct source, since it applies to another
frame
Help please with examples if you can (directly to me)
am*****@frontline.co.uk

many thanks
Jul 17 '05 #1
1 1887
Try this:

Const scUserAgent = "API-Guide test program"
Const INTERNET_OPEN_TYPE_DIRECT = 1
Const INTERNET_OPEN_TYPE_PROXY = 3
Const INTERNET_FLAG_RELOAD = &H80000000
Const sURL = "http://www.microsoft.com/index.htm"
Private Declare Function InternetOpen Lib "wininet" Alias "InternetOpenA"
(ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As
String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function InternetCloseHandle Lib "wininet" (ByRef hInet As
Long) As Long
Private Declare Function InternetReadFile Lib "wininet" (ByVal hFile As
Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long,
lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetOpenUrl Lib "wininet" Alias
"InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl As String,
ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As
Long, ByVal dwContext As Long) As Long
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KP*****@Allapi.net

Dim hOpen As Long, hFile As Long, sBuffer As String, Ret As Long
'Create a buffer for the file we're going to download
sBuffer = Space(1000)
'Create an internet connection
hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_DIRECT,
vbNullString, vbNullString, 0)
'Open the url
hFile = InternetOpenUrl(hOpen, sURL, vbNullString, ByVal 0&,
INTERNET_FLAG_RELOAD, ByVal 0&)
'Read the first 1000 bytes of the file
InternetReadFile hFile, sBuffer, 1000, Ret
'clean up
InternetCloseHandle hFile
InternetCloseHandle hOpen
'Show our file
MsgBox sBuffer
End Sub

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike | last post by:
Hi, I have a question about the Visual Studio .Net IDE, I am wondering if anybody has seen the same problem. The first problem is when I click on Help/Check for Update menu button, I get an...
1
by: RWC | last post by:
Hey Folks! I'm having trouble with an asp page. First off, I'm new to the html / asp world, but not to software development. I'd like to minimize or "normalize" the site, so I'm trying to use...
9
by: Nicole | last post by:
Okay, so I was working primarily in dreamweaver and the site looks very good in both IE (our customers primarily use this) and Firefox (my new 'thing'), but I ran it through the validator and...
1
by: Tim Marshall | last post by:
I'm putting together my first help file (using Easy Help, http://www.easyhelp.com/). So far, so good. I'm able to use the Help File and Help Context ID to have things from my help file pop up...
2
by: David | last post by:
Hello, When the user starts my .aspx page and then opens a new browser window (i.e. through menu or Ctrl + N hotkey) I don't want both pages to share the same Session (HttpApplication.Session)....
5
by: Reza Solouki | last post by:
Help, I posted another thread here asking help because I was losing my session information(got no response). After a lot of searching on different sites I discovered that my sessionID changes...
6
by: drec | last post by:
I am just learning Javascript and I would like to create a basic form that gives me two options. This will be using either checkbox or radio input type, however I would like the second option to...
4
by: Guern1 | last post by:
Hi Need a bit of help here please to point me in the right direction. I have a java class file here which i wish from a menu item to open a web page which contains a help page. ] } else...
3
by: =?ISO-8859-1?Q?Jo=E3o_Maia?= | last post by:
Hi there, I am having a weird problem in trying to use a ASP.NET menu inside a custom web part. I am developing a custom web part that has a menu inside (just the menu, nothing else). The menu...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.