Dim doc As New MSHTML.HTMLDocument Dim html As MSHTML.HTMLHtmlElement Set html = doc.createElement("html") Dim head As MSHTML.HTMLHeadElement Set head = doc.createElement("head") Call html.appendChild(head) Dim body As MSHTML.HTMLBody Set body = doc.createElement("body") Call html.appendChild(body)