Bonjours tout le monde voila j'ai un problème pas trop sympa, en même temps je vous prie d'être indulgent je n'ai pas toucher au Visual Basic depuis que je suis sortis de mon BTS cela fait bien 8 ans.
j'essaye d'ouvrir une URL dans un script SAX basic cela fait 2/3 jours que cela me turlupine et je n'y arrive pas. Je ne sais pas si c'est le bon forum mais j'ai vu que SAX Basic comprend les instructions Visual Basic
voila dans mon script je construit une URL
le browser est gérer par la procédure suivante
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 Sub R7Query(ati As ATInteraction) Dim machineName As String Dim historylocation As String Dim customer As String Dim query As String Dim sTicketNumber As String '********************************************** ' ' generation de l'URL remplacer ici par google.com ' '********************************************** historylocation = "http://google.com" query = historylocation ' Load the default browser and display the specified page debug.print "The querry that will: " & query 'Call LanchBrowser(query) CreateBrowserForiVault True ' Now, navigate to the URL for iVault with parameters IEiVault.Navigate(query) End Sub
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 Sub CreateBrowserForiVault(bMakeTop As Boolean) Dim visible As Boolean Dim currWnd As Long Dim agentWnd As Long On Error GoTo LoadIE ' attempt to get a property in the IE object. if error, then we have no IE object visible = IEiVault.Visible ' IE object already exists, skip creating GoTo ContinueIE LoadIE: ' Create an instance of the IE application Set IEiVault = CreateObject("InternetExplorer.Application") ContinueIE: IEiVault.MenuBar = False IEiVault.StatusBar = False IEiVault.AddressBar = False ' Get the window handle to the IE browser instance currWnd = IEiVault.Application.HWND ' If it is minimized, restore the window If IsIconic(currWnd) Then ShowWindow(currWnd, SW_RESTORE) Else ' If we do not want IE to be the topmost window, ' show it not activated otherwise show it normally If bMakeTop = False Then ShowWindow(currWnd, SW_SHOWNOACTIVATE) Else 'ShowWindow(currWnd, SW_NORMAL) ShowWindow(currWnd, SW_SHOWMAXIMIZED) End If End If End Sub
ce code marche a chaque fois que je R7Query est appelee Internet explorer ouvre l'URL masi dans la fenetre active Or je voudrais que a chaque fois il génère une nouvelle tab et la je sais pas comment faire.
Sur internet j'ai trouver ceci
Mais je ne vois pas comment l'intégrer dans mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Private Sub cmdDoMyTask_Click() On Error GoTo ErrHandler Dim objIE As SHDocVw.InternetExplorer Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible = True objIE.Navigate2 "http://www.microsoft.com/" 'Wait till the page is completely displayed! 'The following three lines are not needed if 'you don't want to wait for the 1st page to display completely While objIE.ReadyState < 4 Sleep 100 Wend 'Open in new Window (u need to pass the value 1) objIE.Navigate2 "http://www.live.com/", 1 'Open in new Tab (u need to pass the value 2048) objIE.Navigate2 "http://www.msn.com/", 2048 Set objIE = Nothing Exit Sub ErrHandler: Set objIE = Nothing End Sub
Partager