• Convert VB Code From Word 97 to Word 2003 (Word 2003)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Convert VB Code From Word 97 to Word 2003 (Word 2003)

    Author
    Topic
    #437698

    We’ve used many macros designed in Word 97 and have been hesitant to convert to Word 2003 because of the issues. Preconversion I made changes to several macros; however, I’m having trouble with one line. Many macros refer to several Addins, ie.

    Templates(STRSTARTUPPATH & “ADDIN-Name of Addin.dot”).AutoTextEntries(“NameOfAutoTextEntry”).Insert where:=Selection.Range, RichText:=True

    I get compile errors on this old code and no matter how I change it, I can’t get it to work.

    Suggestions?

    Viewing 0 reply threads
    Author
    Replies
    • #1041412

      Welcome to Woody’s Lounge!

      The VBA dialect for Word hasn’t really changed from Word 97 to Word 2003, except for adding elements corresponding to new features. So in theory, macros written in Word 97 should still work in Word 2003.
      The code you posted is syntactically correct, providing STRSTARTUPPATH has been defined. Can you tell us the text of the compile error you get?

      • #1041580

        Sorry for the delay – family emergency…

        I’ll be addressing errors in order of importance, so the compile error will come later. For now:

        We used to be able to create a letter by double clicking a macro button on a locked form. The letter would pull appropriate info from fields that had been completed on the locked form. Now we get:

        Run-time error’-2147352573 (80020003)’:

        This method or property is not available because the document is a protected document.

        How can I get around having to unlock the form?

        Thanks
        Snowflake

        • #1041585

          Sorry, but you’ll have to provide more detailed information. Macro buttons still work in protected documents, but some code doesn’t. Which line causes the run-time error?

      • #1041773

        It’s more complex than that.

        Some things did have semantic changes, I think there’s at leasta partial list in the Help in Word 2000.

        The biggest changes may be:

        1. Userforms may be modeless in post Office 97, and that can cause havoc. To eliminate this issue, make ALL Userforms modal to avoid change in behavior.

        2. The change to SDI causes real problems on code flow and appearance. I think that I have an example of SDI use that might help. See http://www.standards.com/index.html?VBACodeSnippets%5B/url%5D.

    Viewing 0 reply threads
    Reply To: Convert VB Code From Word 97 to Word 2003 (Word 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: