Results 1 to 3 of 3
  1. #1
    kelliel
    Guest

    Re: Some macros in this template will not run properly

    Probably, the template is still a Word6 document. It needs to be permanently converted, which means you will need to actually go through the code line by line to make it compliant with VBA.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Some macros in this template will not run properly

    That's right. This is one of those beyond-my-control issues. I wish it weren't so. I'd like AT LEAST to be able to trap the condition, log an error report, and continue processing files.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Some macros in this template will not run properly

    When Word97SR2 attempts to open a template that has a WordBasic syntax error, it issues a pop-up message box that reads:"Some macros in this template will not run properly in Word" etc.

    An attempt to trap this with an On Error statement fails. I seem to recall that most if not all of the 3rd-party converters used by MSWord cause the same sort of problems.

    If anyone has a solution, I'd be pleased to hear it.

    I'm in the business of opening templates in unattended mode, and it bugs the heck out of me to return to the machine and find one of these things waiting for me these past five hours.


    FWIW the offending code appears below. Once I click on "OK" the converter appears to embrace the faulty keyword in double-quotes and get on with its life.



    <pre>WordBasic.EditReplace Find := " ", ReplaceAll := " ", Direction := 0,_
    "matcase" := 0, WholeWord := 0, patternmatch = 0, Wrap := 0
    ^^^^^^^^^
    matchcase
    </pre>



    My code to open this particular template looks like this:

    [pre]
    Sub test()
    On Error GoTo cantopen
    Documents.Open FileName:="h:templates9980520.dot", ReadOnly:=True,_
    ConfirmConversions:=False
    GoTo canopen
    cantopen:
    MsgBox "failed to open"
    canopen:
    End Sub
    [/pre

Posting Permissions

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