I'm trying to figure out a way to have a specific web browser open (Internet Explorer for example) when a URL is clicked using VB.net
As I have it now, my code creates and sends out an email that displays a title and a hyperlink for the user to click on. Right now, the hyperlink opens the default browser, but I want to make it always open Internet Explorer.
The code below is what I have for displaying the Hyperlink. It displays "View Document" and the prints the hyperlink underneath. The hyperlink in this case is stored in my LinkLabel since its already part of the application somewhere else
What do I need to add to the code so that it defaults to Internet Explorer when it is clicked?
I have come across suggestion of using the full file path to Internet Explorer on the C: Would that work?
<a href=microsoft-edge:http://example.com>my link</a>
Update:
... & "my link" + ...
Related
I am trying to create a macro to download a file from a web page. I have coded the login and navigating to main download page however, unable to get codes to click on a drop-down menu on a web page. I need to click on 3 dots then click on Download xlsx to start downloading the file. I can not proceed to rest of the codes until file is downloaded. Here is the link to HTML properties of this dropdownlist
obj.FindElementsByClass("ant-dropdown-menu-item").Click
I had figured out the solution. I had to click on the blank space to get that drop down buttons appear. Then clicked as usually. I got the element path form Chropath chrome add on and used xpath.
Obj.FindElementByClass("insight__header").Click '-----------This clicks on blank space to show 3 dots.
Obj.FindElementByXPath("/html[1]/body[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/header[1]/span[2]/div[1]/button[1]/i[1]/*").Click '---------This cicks on 3 dots and displays the menu.
Obj.FindElementByXPath("/html[1]/body[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/ul[1]/li[4]/span[1]").Click '---------This clicks on Download xlxs button to start downloading the file.
I'm trying to automate the process of saving PDF invoices for bookkeeping purposes. The method suggested here does not work because a login is required to access the invoices.
I currently have a macro that navigates to the page, logs in and opens the links to each invoice. The URL scheme for these invoices is .../account/invoice/?invoice_number=XXXXXX. Navigating to each of these URL brings up the files in the
window. I would like the files to automatically save, but according to this page, the Always ask before opening this type of file option was depreciated from IE 10 and 11 due to security reasons.
I attempted to automatically click Save using this method, but the code here seems to be for a different version of IE.
The line:
hWnd = FindWindow("#32770", "File Download")
was modified to:
hwnd = FindWindow("#32770", "View Downloads - Windows Internet Explorer")
This successfully captures the download window, but it fails to find the &Save button for me to click. My guess would be that it's because there are multiple save buttons.
Any ideas would be greatly appreciated! Thanks.
I want my users to be able to click a button to open my company webpage in the default browser with specific size(Like-width=SomeSize,height=SomeSize')when clicked. How would I do this?
I'm using VB.net so all .net examples are acceptable.
To do this in whatever browser the user has installed would be very difficult. Each browser has its own command line arguments, so you would have to detect which browser is being used, and code for all possible browsers..
If you are willing to have windows open the page in Internet explorer, you could use add a reference in your solution explorer to the windows Shell Document Viewer.
To do this, in your solution explorer window, right-click on "References".
Click "Add Reference". This opens the "Reference Manager" window
In the window that opens, down at the bottom right click the button "Browse"
In the file dialog, in the file name box type "C:\Windows\System32\shdocvw.dll" without quotes.
Click the "Add" button. and the dialog should close, leaving you with the "Reference Manager" window.
In this window, in the list in the middle, you should see "shdocvw.dll" with a tick next to it. Click the "Ok" button.
You now have a reference to the Shell Document Viewer
Finally, add the following code to wherever you want the window to open and change the parameters to whatever you require
Dim TheBrowser = New SHDocVw.InternetExplorerMedium With {
.Visible = True,
.Width = 500,
.Height = 500
}
TheBrowser.Navigate(URL:="http://www.google.com")
You can just write:
System.Diagnostics.Process.Start("http://google.com")
I have struck with one issue not finding any workable solution. Googled a lot without any success…HELP PLEASE.
Situation: Using MS Access 2010, there is one Form with WebBrowser Control (Unbound) for conducting some search, when I click the results of the search a Pop-up new Internet Explorer window opens for the search result.
Requirement: I need “new Internet Explorer window” needs to be opened on existing WebBrowser Control..... NOT to open separately as new pop-up Internet Explorer window.
Kindly provide me solution (MS Access 2010/VBA) or workaround….
Regards,
Sandy
Can you open the form that you are opening in the WebBrowser Control in a new browser window outside of the application in order to test something. Check to see, if when you open the url, and then invoke the search, if the results open in a new window for that browser. If so, then check the target of the form within the first screen to get the name of the window that the page is trying to open the results in. If the target is specified, then you will need to write code to remove it when the page loads.
Just assign the new web address to your webbrowser control. something like this. Note it has to include equal sign and a hyper-link surrounded by quote.
Private Sub WebBrowser34_Click()
Me.WebBrowser34.ControlSource = "='www.google.co.uk'"
End Sub
My current program that I am using, from excel, navigates to a web page where it downloads a lot of information. I primarily do this from excel because the data is in excel format.
I have it go to the page, click on a link and the open/save/cancel dialog box appears it automatically selects save and saves it to the last folder I saved anything in. Then it waits for the dialog box title to read "download complete" then close it and initiates the next download.
The issue I'm running in to, is that other people who use this program have the "close dialog box when download completes" option selected, and this interrupts the overall process.
Is there a way to change this setting from the excel VBA code, or will I need to explore a different method of dealing with this issue? Having the program do a direct download URL string is also not viable as the website needs to be logged in to and the request must come from the open window, (I have already attempted that method).
Use URLDownloadToFile to download from the internet, trying to use IE will lead to other issues:
VBA - URLDownloadToFile - Data missing in downloaded file