Results 1 to 31 of 31

Thread: [WORD] Problem to open document

Hybrid View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Location
    Charleroi (Belgium)
    Posts
    18

    Re: [WORD] Problem to open document

    hmm i see, it is possibble, i'm agree but my application works perfectly on my laptop? why not on my desktop computer???

    i already have tried to see where it bugs and it is when the application try to open the document.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: [WORD] Problem to open document

    For your programs EXIT button, substitute this code. It will unload everything that is open.
    VB Code:
    1. Private Sub Command1_Click()
    2.  Dim frm As Form
    3.   Dim obj As Object
    4.   For Each frm In Forms
    5.      If frm.Name <> Me.Name Then ' Unload this form LAST
    6.        For Each obj In frm
    7.          On Error Resume Next
    8.            Unload obj
    9.            Set obj = Nothing
    10.        Next
    11.        Unload frm
    12.        Set frm = Nothing
    13.      End If
    14.     Next
    15.     On Error Resume Next
    16.       For Each obj In frm
    17.         Unload obj
    18.         Set obj = Nothing
    19.       Next
    20.       Set frm = Nothing
    21.       Unload Me
    22. End Sub

  3. #3
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: [WORD] Problem to open document

    I suspect you are using Getobject to open instances of word this would be the fundamental cause of your problem. if so use this:
    Code:
    on error resume next
    getobject("Word.Application")
    if Err then
         creatobject("Word.Application")
    end if
    on error goto ..... 'to your normal error handler
    instead, it
    will prevent opening so many instances of word in the first place. leaving memory for other proccesses
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

Posting Permissions

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



Click Here to Expand Forum to Full Width