Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word saves interrupt typing (Office 2000/XP/2003)

    Our app has a feature which, at the user's request, saves a document every 'x' minutes (where they specify 'x'). Occasionally, when they are typing, the save kicks off and for a few seconds nothing shows up on the screen (even though they are typing away). We have backgroundsave=TRUE and FastSave=FALSE. Any suggestions for dealing with this? Thanks....

    Dan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Word saves interrupt typing (Office 2000/XP/2003)

    Not very serious ones:
    - Keep the documents small.
    - Let the users buy faster PCs with more memory.
    - Teach the users to be patient.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    Is it possible that your app is killing the keyboard buffer? If so, can you find a way to avoid that?

  4. #4
    New Lounger
    Join Date
    Jan 2005
    Location
    Boston, Massachusetts, USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    jscher2000, I'm intrigued by your 'keyboard buffer' idea, and after a little researching I discovered that it could be that Windows itself handles the queue for whatever the user types rather than Word.

    Could it be that when Word is being told to Save (via VBA at set intervals) while the user continues typing it requests process time to undertake that task at a higher priority than taking further input from the user until its done?

    I say this only because after the Save any text typed while Saving gets added to the Word doc in one go rather than appear a character at a time.

    So I guess my point is, is there a way to lower the priority of Saving over accepting input from the user? 'Allow Background Saves' is already set to true.

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    > after the Save any text typed while Saving gets added to the Word doc in one go rather than appear a character at a time.

    This is how it is supposed to work, I think. While the Word window is busy, Windows holds the input, up to some capacity limit, and then delivers it to the window when the Word window comes up for air. I suspect that Word would not want the document to change during the time it is trying to save it, so it may not be possible to change this.

  6. #6
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    I was intrigued by the keyboard buffer idea as well. What really puzzles me is that this behavior *appears* to be new with the latest release of the product. The main difference is that we used to use two subdocuments to hold some protected data. We changed that to two sections (minus the subdocs), because we were worried about subdocs' notorious flakiness. So--why would the documents save faster with subdocs rather than sections? The only theory I've thus far is that we are protecting the sections by using the App WindowSelectionChange event as shown below; basically, if the user moves the cursor into a protected section, we bounce them out (we didn't want to use protected forms because they disable too much of Word's menu items). I thought that perhaps that this SelectionChange handling was tying Word's save mechanism in knots, so I disabled it during the save. However, that didn't seem to help either. Still looking for ideas....Dan

    Private Sub App_WindowSelectionChange(ByVal Sel As Selection)
    100 On Error GoTo hErr
    105 Dim lStart As Long, lEnd As Long
    106 If m_bIgnoreSelectionChange Then
    107 Exit Sub
    108 End If
    110 If m_bEditScriptDocInFocus Then
    115 If geTraceLevel >= tlHEAVYDEBUG Then
    120 lStart = GetTickCount
    125 End If
    130 With Sel.Range
    135 If .InRange(m_rngSection1) Then
    140 m_rngSection2.Characters(1).Select
    145 Selection.Collapse
    148 Selection.Document.ActiveWindow.VerticalPercentScr olled = 0
    150 ElseIf .InRange(m_rngSection3) Then
    155 With m_rngSection2
    160 .Characters(.Characters.Count).Select
    165 End With
    170 Selection.Collapse
    172 Selection.Document.ActiveWindow.SmallScroll 1
    175 End If
    180 End With
    185 If geTraceLevel >= tlHEAVYDEBUG Then
    190 lEnd = GetTickCount
    195 Debug.Print (lEnd - lStart) & " milliseconds"
    200 End If
    205 End If
    ' CSErrorHandler begin - please do not modify or remove this line
    215 Exit Sub
    220 hErr:
    225 Dim lErrNum As Long
    230 Dim sErrMsg As String
    235 Dim lErl As Long
    240 lErrNum = Err.Number
    245 sErrMsg = Err.Description
    250 lErl = Erl
    255 On Error GoTo 0
    260 GlobalErrorsLog "EventClassModule.App_WindowSelectionChange", "Error " & lErrNum & ": " & sErrMsg & vbCrLf & _
    "in EditScript.EventClassModule.App_WindowSelectionCha nge." & vbCrLf & _
    "The error occured at line: " & lErl

    End Sub

  7. #7
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    Well, there's more than one way to skin a cat. After spending a few hours studying the way windows handles keyboard input, I decided to try a different tack. Now I create a minimized temporary document, periodically paste the contents of the section I want to save into the temp doc, and save the temp doc. This doesn't interfere with the typing. (Thus going to show that you can usually bludgeon Word into doing your will). One question though: anybody know how make the icon for a specific document not show up in the task bar? If possible, I'd like to hide the icon for the minimized temp doc. Thanks...

    Dan

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    Do you do all this in code, or manually?

    If you handle it in code, you can keep the temp document entirely hidden: both the Documents.Add method (to create a new document) and the Documents.Open method (to open an existing document) have an argument Visible. If you set it to False, the document will not be listed in Word's Window menu or in the Windows task bar, but it will still be available to your VBA code. For example:

    Dim docHidden As Document
    Set docHidden = Documents.Add(Visible:=False)
    ...
    ...
    docHidden.Contents.Paste
    docHidden.SaveAs Filename:="..."

  9. #9
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    Thanks Hans. I did try that, but ran into a problem. For some reason, when the doc is opened like that and you then save it, it displays the "saving xxxx" progress bar briefly across the center of the active document. I tried for a couple of hours to make that stop, then gave up.

    Dan

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    That sounds like some kind of glitch of your video card. I tried it with a lengthy document, and the save progress bar for the invisible document was displayed in the status bar, as it should.

  11. #11
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word saves interrupt typing (Office 2000/XP/20

    Thanks Hans. I'll check it out on another machine...Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •