Consulting

Results 1 to 2 of 2

Thread: ~!doc1.doc created .. why?

  1. #1

    ~!doc1.doc created .. why?

    Please let me know why every time when I create a Word doc from VBA through VB6 ("doc1.doc") I am getting "~!doc1.doc" at the same time. It would dissappear after I open/close "doc1.doc"?
    I have closed the object with "Set objApp = Nothing", is it NOT enough!?
    Thanks!

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Mr Doubtfire
    Please let me know why every time when I create a Word doc from VBA through VB6 ("doc1.doc") I am getting "~!doc1.doc" at the same time. It would dissappear after I open/close "doc1.doc"?
    I have closed the object with "Set objApp = Nothing", is it NOT enough!?
    Thanks!
    Word always creates a tempfile that is about the same size as the opend document. That's design by default an Word needs that to work with the document.

    Well The Set alone isn't enough.

    If you are creating a Document and a Application Object you need to:

    objDoc.Close False
    objApp.Quit False
    Set objDoc = Nothing
    Set objApp = Nothing
    So it al comes down to how your code looks and where not seeing that.

    Enjoy!
    Last edited by Aussiebear; 04-19-2023 at 05:11 PM. Reason: Adjusted the code tags
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

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