1. Amruta Chavan
  2. PowerBuilder
  3. Thursday, 5 May 2022 18:26 PM UTC

Hi All,

 

I want to open an html file using Microsoft Edge; could anyone please help with this.

I am able to open using Internet Explorer; but dont knw how to open it using edge.

I used below code for InternetExplorer

IE = create OLEObject

IE.ConnectToNewObject("InternetExplorer.Application")

IE.Open("Filename")

 

I dont know the classname to be used for MicrosoftEdge in place of InternetExplorer.

I have tried using GetContextService("Internet", inet_url) ; but it uses the default browser

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 5 May 2022 20:02 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Amruta -

The following code snippet is one way to do this (substitute your URL):

Integer li_rc

li_rc = Run("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe https://www.appeon.com")

MessageBox("Run","RC = "+String(li_rc))

I had to specify the full path to the MSEdge executable in order for this to work, and MSEdge may not always reside at the same location on everyone's PC.

You can probably find its location in the Windows Registry, but I've not done that.

Note that this method simply starts Edge (if not already open) and does not wait. If Edge is already open, a new tab will be opened.

Best regards, John

Comment
  1. Roland Smith
  2. Thursday, 5 May 2022 20:32 PM UTC
Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe



The Default value for the key will be the full path of msedge.exe.
  1. Helpful 4
  1. John Fauss
  2. Thursday, 5 May 2022 21:01 PM UTC
Thank you for the assist, Roland!
  1. Helpful
There are no comments made yet.
Amruta Chavan Accepted Answer Pending Moderation
  1. Friday, 6 May 2022 08:05 AM UTC
  2. PowerBuilder
  3. # 1

Hi John,

 

Thank you for your response.

I was able to open the file using Edge.

But I have a concern; with Internet Explorer ConnectToNewObject option , I was able to validate whether I can access InternetExplorer.

How should I verify this for Edge.

Comment
  1. Roland Smith
  2. Friday, 6 May 2022 13:33 PM UTC
ConnectToNewObject implies interacting with the COM interface. Edge does not support COM.
  1. Helpful
  1. Amruta Chavan
  2. Friday, 6 May 2022 14:22 PM UTC
Hi John,

Yes I meant verifying the existence of the exe.



Hi Smith,

Okay, thank you!





  1. Helpful
  1. Amruta Chavan
  2. Friday, 6 May 2022 14:27 PM UTC
I have one more concern, how do we quit or close the edge browser; or find out if the session is alive
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.