Bonjour,
J'ai créé un objet Internet Explorer dans mon script vb de façon à ce qu'il affiche une fenêtre IE que j'ai personnalisé avec du code HTML.
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
| Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
'Création de la fenêtre IE
objExplorer.Navigate "about:blank"
objExplorer.Left = 100
objExplorer.Top = 100
objExplorer.Height = 400
objExplorer.Width = 550
objExplorer.MenuBar = 0
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.document.Title = "MAJ"
objExplorer.document.ParentWindow.document.body.scroll= "no"
objExplorer.document.ParentWindow.document.body.style.borderStyle = "outset"
objExplorer.Visible = 1
strStart = "<html>"
strStart = strStart & "<body>"
strStart = strStart & "<title>MAJ</title>"
strStart = strStart & "<center><img src='toto.gif' alt='toto'></center>"
strStart = strStart & "<center><font color='orange' size='4pt'><b>Mise à jour</b></font></center>"
strStart = strStart & "<br /><br />"
strStart = strStart & "<hr />"
strStart = strStart & "<br />"
strStart = strStart & "<center><b>Avancement...</b></center><br /><br />"
strEnd = strEnd & "<br /><br />"
strEnd = strEnd & "<br /><hr />"
strEnd = strEnd & "<br />"
strEnd = strEnd & "<center><font size='2pt'>©2009 - Srini - <a href = 'mailto:moi@srini.com'>Contact</a></font></center>"
strEnd = strEnd & "</body>"
strEnd = strEnd & "</html>"
objExplorer.Document.Body.InnerHTML = strStart & "Début de l'opération..." & strEnd |
Ce script marche bien...sauf pour l'affichage de l'image. La page IE créée ne trouve pas l'image. Il m'affiche le contenu du "alt" de la balise IMG mais l'image n'apparaît pas. Je me demande s'il n'y a pas un problème au niveau des quotes ('...') dans la balise IMG.
C'est également le cas pour la balise
<link rel='stylesheet' type='text/css' href='style.css' />
pour le CSS qui ne marche pas (dans la version précédente j'avais bien mis les balises div avec des id).
Merci d'avance pour votre aide.
Partager