Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Buffering for MS Word (Word)

    Hi All,
    1. im writing a application in which i'm hoocking the API of MS Word & using my method for Save As of MS Word.
    In Save As i'm trying to buffer the data in _WriteFile API & my buffer size is 64 kb. Till 64 kb im buffering the data in buffer & then write it into file. If _WriteFile function is getting data more than 64 kb then im old buffer & then new buffer.
    Buffering is right but im getting the error "the save failed due to out of memory of disk space (FilePathFilename.doc)"
    If im not using buffer then its working perfectly.

    2.There server & client based application. User opens the file on server side from client side. Now user wants to save the file on client side(after changing the file or using SAVE AS). If i'm not using buffering then MS Word sends packet (for _WriteFile) of size like 1 kb or 10 kb or 0.5 kb or 30 kb ... etc.
    So it takes time to send the data on client side. So i'm doing buffering (of 65 kb)& then send the data on client side. So it improves time efficiency.

    3.One more thing i want to say....
    You know when we write any thing in MS Word file using MS Word then it makes a *.tmp file & writes all thing in that & at last MS Word replaces the .*tmp into original file using _ReplaceFile.

    I checked _WriteFile writes the data in *.tmp file successfully but in case of buffering it is not able to call _ReplaceFile API after _WriteFile.

    Please tell me now where is the problem.

    Thanks
    Krishna

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

    Re: Buffering for MS Word (Word)

    Welcome to Woody's Lounge.

    Are you writing a text file? If so, I don't understand what Word's .tmp file has to do with it.
    Why do you want to use Windows API functions to replace Word's built-in Save As method?

  3. #3
    New Lounger
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Buffering for MS Word (Word)

    I'm writing .doc file using MS Word & save it using SAVE AS in .doc file. i'm redirecting the MS Word API to client side.

    Thanks
    Krishna

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

    Re: Buffering for MS Word (Word)

    What is this MS Word API you mention? I have only programmed Word in VB/VBA and there is no WriteFile method there. I know there is a Windows API function WriteFile, but that is not suitable to save a Word document.

  5. #5
    New Lounger
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Buffering for MS Word (Word)

    I'm using SDK: File Systems functions. When we click on SAVE AS then MS Word calls CreateFile (it creates a *.tmp file) & then WriteFile function & writes the whole data in *.tmp file & there finishing write data .. then it calls ReplaceFile .. & ReplaceFile replaces the *.tmp file into target file. many others calls also come in between.
    Its cleared now???

    thanks
    Krishna

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

    Re: Buffering for MS Word (Word)

    I'm afraid I don't know anything about that. This may not be the ideal forum for you, our focus is on interactive use and on VBA programming.

  7. #7
    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: Buffering for MS Word (Word)

    Just as a footnote, Word's error messages when it fails to save a file successfully sometimes bear no relation to the true problem that Word is encountering. For example, a corrupted embedded (OLE ) object can cause "out of disk space" or "no permission" errors.

Posting Permissions

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