title: Microsoft access vba-shift focus from access to word
body: <p>I am creating and opening a word document through access 2007 vba. The document is created but the focus is not shifted to word. Instead the focus still remains on access form through which am creating the doc. Below is my code:</p>
  
  <pre><code>Dim obj As Word.Application
  Dim wor As Word.Document
  Dim str As String
  
  str = "C:\hello\folder1\vin.dot"
  
  Set obj = CreateObject("Word.Application")
  Set wor = obj.Documents.Add
  
  With wor
  
   .SaveAs str
  
   .Close
  End With
  
  
  obj.Visible = True
  obj.Documents.Open str
  
  obj.WindowState = wdWindowStateMaximize
  </code></pre>
  
  <p>Any sugesstions please.</p>