Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Thanked 0 Times in 0 Posts

    Cancel button (word 97, word 2000)

    I have a Word Document open (it has no macros in it). I open another Word document with macros in it. A message comes up saying " The Document you are trying to open contains macros. Some macros may countain harmful viruses. If you are sure this document is from a trusted source. click Yes. If you are not sure and want to prevent any macros running, click No". It has 3 buttons Yes No Cancel. When i click the cancel button I get a Run Time error 102 Command failed and when i clicked the Debug button on the Error message i found that the Normal template had a new Module WordTmpDDEMod
    Sub TmpDDE()
    WordBasic.FileOpen Chr(34) + "" + Chr(34)
    End Sub

    What should I do to avoid this error message?


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Cancel button (word 97, word 2000)

    If you want to avoid the error message that occurs if the user clicks Cancel, you can trap this error:

    Sub Something()
    On Error GoTo ErrHandler
    Documents.Open "..."


    Exit Sub

    Select Case Err
    Case 102
    Resume Next
    Case Else
    MsgBox Err.Description
    End Select
    End Sub

    Note: The module in doesn't seem very useful. Unless you need it, I would remove it.

Posting Permissions

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