Jump to content
Sign in to follow this  

Word Embedded in a GUI + IE7

Recommended Posts


This method from big_daddy has worked successfully for me up till now that I have IE7 installed...

Prior to IE7 the word document would open embedded in my gui, now that I have IE7 though, (I'm guessing because of the way that IE7 handles only web content and kicks file-system stuff out to Explorer), it's opening Word separately instead of in my embedded window.

Does anyone know of a different way to achieve this, or what I need to/can change to make this work again?

big_daddy's example:

#include <IE.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded()

GUICreate("Embedded Word control Test", 640, 580, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Button_Open = GUICtrlCreateButton("Open File", 10, 420, 100, 30)


While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
        Case $GUI_Button_Open
            $sFile = FileOpenDialog("Open Word File", @MyDocumentsDir, "Word Doc (*.Doc)")
            If $sFile <> "" Then
                _IENavigate ($oIE, $sFile, 0)
                While $oIE.ReadyState <> 4
                $oDoc = $oIE.Document
                $oWord = $oDoc.Application
                ; Put document into 'Web View' mode
                $oWord.Activewindow.View = 6
                ; Manage display of toolbars
                $oDoc.CommandBars ("Reviewing").visible = False
                $oDoc.CommandBars ("Standard").Visible = True

_IENavigate ($oIE, "about:blank")
$oDoc = 0
$oWord = 0


Edited by exodius

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.