Hi,
In an Excel module i create a Word Document. When the document opens, there should simultaniously appear a MsgBox (or UserForm) with instructions about de Word document, however the MsgBox or Userform is blocked by the Word document and shows up in the inactive Excel sheet. Does someone know a solution for this problem?
[vba]
Sub MsgBoxInDocu()
Dim wdApp As Object
Dim wdDoc As Object
On Error Resume Next
'Get existing instance of Word if it exists.
Set wdApp = GetObject(, "Word.Application")
If Err <> 0 Then
'If GetObject fails, then use CreateObject instead.
Set wdApp = CreateObject("Word.Application")
Err.Clear
End If
Set wdDoc = wdApp.Documents.Open("C:\Test\TestDocument.doc")
wdApp.Visible = True
Application.ActivateMicrosoftApp xlMicrosoftWord
wdApp.ActiveWindow.WindowState = wdWindowStateMaximize
End Sub
[/vba]
Regards and thanks in advance,
Stranno