Hello,

I've inherited a Word template that is integrated with my firm's document management software (iManage). Whenever the document is saved (either by the user or autosave) the footer.dot kicks in and places a "filestamp" with the assigned document number in the footer. All of this works fine. The problem is when the footer.dot is finished running it returns focus back to the document at the insertion point and not the page taht was currently being viewed. Here is the problem code:

VB Code:
  1. UserView = ActiveWindow.View.Type
  2.         Set thisdocument = ActiveDocument
  3.         With ActiveDocument.Bookmarks
  4.             .Add Range:=Selection.Range, Name:="dfwhere"
  5.         End With
  6.  
  7.         ViewState = ActiveWindow.View.ShowAll
  8.         ActiveWindow.View.ShowAll = True 'show all codes
  9.         For Each aSection In thisdocument.Sections
  10.             For Each aFooter In aSection.Footers
  11.                 If aFooter.Exists = True Then
  12.                     aFooter.Range.Fields.Update
  13.                 End If
  14.             Next aFooter
  15.         Next aSection
  16.  
  17.         Selection.GoTo What:=wdGoToBookmark, Name:="dfwhere"
  18.         Selection.Find.ClearFormatting
  19.         ActiveDocument.Bookmarks("dfwhere").Delete
  20.         ActiveWindow.View.ShowAll = ViewState
  21.         ActiveWindow.View.Type = UserView
  22.         Application.ScreenUpdating = True
  23.     End If
  24.  
  25.     ActiveWindow.View.Type = wdNormalView
  26.     ActiveWindow.View.Type = wdPrintView
  27.     ActiveWindow.View.Type = UserView
  28.     Application.ScreenUpdating = True
  29.    
  30. End Sub

The question is, can I set the focus back to the document without having to go back to the insertion point? I basically just want it to work like a regular save.

Please keep in mind that I'm a noob and I didn't write this code, I'm only trying to fix it.

Thanks,