Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Dec 2006
    Location
    Alberta
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert VB Code From Word 97 to Word 2003 (Word 2003)

    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?

  3. #3
    New Lounger
    Join Date
    Dec 2006
    Location
    Alberta
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert VB Code From Word 97 to Word 2003 (Word 2003)

    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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert VB Code From Word 97 to Word 2003 (Word 2003)

    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?

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert VB Code From Word 97 to Word 2003 (Wor

    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.

Posting Permissions

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