2

How can I display an image in a MsgBox?

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
angel
  • 73
  • 1
  • 4
  • 8

2 Answers2

3

The answer is: This is not possible. MsgBox can only display strings. (Documentation)

An alternative is to display your image in a small Internet Explorer window. Here's an example:

Set objExplorer = CreateObject("InternetExplorer.Application")

With objExplorer
    .Navigate "about:blank"
    .ToolBar = 0
    .StatusBar = 0
    .Left = 100
    .Top = 100
    .Width = 200
    .Height = 200
    .Visible = 1
    .Document.Title = "Important image!"
    .Document.Body.InnerHTML = _
        "<img src='http://sstatic.net/stackoverflow/img/venn-diagram.png' height=100 width=100>"
End With

This should display the Venn diagram found in Stack Overflow's about section.

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
1

What you want is called a HyperText Application, or HTA. You use HTML to create the form.

Zymos
  • 26
  • 1
  • yeah I have made a question about making a dialogbox and someone mentioned the same thing you did. thanks for the help I will definitely practice this language as well. – angel Aug 25 '11 at 07:07