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:
UserView = ActiveWindow.View.Type Set thisdocument = ActiveDocument With ActiveDocument.Bookmarks .Add Range:=Selection.Range, Name:="dfwhere" End With ViewState = ActiveWindow.View.ShowAll ActiveWindow.View.ShowAll = True 'show all codes For Each aSection In thisdocument.Sections For Each aFooter In aSection.Footers If aFooter.Exists = True Then aFooter.Range.Fields.Update End If Next aFooter Next aSection Selection.GoTo What:=wdGoToBookmark, Name:="dfwhere" Selection.Find.ClearFormatting ActiveDocument.Bookmarks("dfwhere").Delete ActiveWindow.View.ShowAll = ViewState ActiveWindow.View.Type = UserView Application.ScreenUpdating = True End If ActiveWindow.View.Type = wdNormalView ActiveWindow.View.Type = wdPrintView ActiveWindow.View.Type = UserView Application.ScreenUpdating = True 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,




Reply With Quote