WD97: Addin Field Data Lost in Word 6.0/7.0 Conversion

Last reviewed: August 15, 1997
Article ID: Q169981
The information in this article applies to:
  • Microsoft Word 97 for Windows on the following platforms: Alpha, Windows NT, Windows 95

SYMPTOMS

The contents of an Addin field may be incomplete when you convert documents between Microsoft Word 6.0, Microsoft Word for Windows 95, version 7.0, and Microsoft Word 97. This problem occurs in all of the following cases.

Case 1

Insert an Addin field into a Microsoft Word 6.0 or 7.0 document and then open that document in Microsoft Word 97.

Case 2

Insert an Addin field into a Microsoft Word 97 document, save the document as Word 6.0/95 or Rich Text Format (RTF), and then open that document in Microsoft Word 6.0 or 7.0.

Case 3

Insert an Addin field into a Microsoft Word 97 document, and then open that document in Microsoft Word 6.0 or 7.0 with the Microsoft Word 97 import converter (Wrd97cnv.exe).

CAUSE

The conversion process changes the contents of the Addin field from ANSI to Unicode.

RESOLUTION

To correct the problem in Case 1, install Microsoft Word 97 Service Release 1 (SR-1).

For additional information about SR-1, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q172475
   TITLE     : OFF97: How to Obtain and Install MS Office 97 SR-1

NOTE: SR-1 does not correct the problems in Case 2 or Case 3.

To work around this problem, use document variables to create and store variables within your document.

Microsoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.

The following Visual Basic for Applications code example adds a document variable named "Value1" to the active document. The code then retrieves the value from the Value1 variable, adds 3 to it, and displays the results.

   Sub AddDocVar()
      Dim MyDoc As Document
      Set MyDoc = Documents.Add
      MyDoc.Variables.Add name:="Value1", Value:="1"
      MsgBox MyDoc.Variables("Value1") + 3
   End Sub

MORE INFORMATION

The following sample macros exhibit the problems described in the "Symptoms" section of this article.

Case 1

Data stored in a Addin field may be corrupted opening a word 6.0/95 document in Word 97.

  1. In Word 7.0, run the following macro to insert a Addin field.

          Sub MAIN
            InsertField ("ADDIN")
            CharLeft
            PutFieldData ("123")
          End Sub
    
    

  2. Save the document as a Word document.

  3. Open the document in Word 97.

  4. Place the insertion point in the Addin field and then run the following macro to display the contents of the Addin field.

          Sub DisplayAddinFieldData()
             MsgBox WordBasic.GetFieldData$()
          End Sub
    
    
NOTE: The field should contain "123"; however, the last character is a vertical bar: "12|." This problem may occur with three and seven digit character strings.

Case 2

Data stored in an Addin field may be corrupted saving a word 97 document as either a Word 6.0/95 document or as a Rich Text Format (RTF) file.

  1. Open Word 97 and run the following macro to insert an Addin field.

          Sub CreateAddinField()
             WordBasic.InsertField ("ADDIN")
             WordBasic.CharLeft
             WordBasic.PutFieldData ("test")
          End Sub
    
    

  2. Save the document in Word 97 format.

  3. Put the insertion point in the Addin field and run the following DisplayAddinFieldData macro to display the contents of the Addin field.

          Sub DisplayAddinFieldData()
             MsgBox WordBasic.GetFieldData$()
          End Sub
    
       The word "test" is displayed.
    
    

  4. Save the document in Word 6.0/95 format.

  5. Close and reopen the document.

  6. Run the DisplayAddinFieldData macro.

NOTE: The letter "t" is displayed instead of the word "test."

Case 3

Addin fields are not converted in Word 7.0, when opening a Word 97 document with the Word 97 converter.

  1. Create a new Word 97 document and insert an Addin field using the following CreateAddinField macro.

          Sub CreateAddinField()
             WordBasic.InsertField ("ADDIN")
             WordBasic.CharLeft
             WordBasic.PutFieldData ("test")
          End Sub
    
    

  2. Save the document as a Word 97 document.

  3. Open the Word 97 document in Word 7.0.

NOTE: The Addin field will now be displayed as a "pimprivate" field. The GetFieldData statement will not work on this field.

REFERENCES

For information about Addin fields, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q140868
   TITLE     : ADDIN Field Not Documented in Word 5.x Help

   ARTICLE-ID: Q140868
   TITLE     : ADDIN Field Not Documented in Word 6.x Help

For more information about obtaining the Word 97 import converter for Word 6.0 and 7.0, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q162214
   TITLE     : How to Obtain the Word 97 Converter

For more information about saving documents in other file formats, click the Office Assistant, type "saving in another format" (without the quotation marks), click Search, and then click the "Results of saving Word 97 documents in other file formats" topic.

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Word Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q120802
   TITLE     : Office: How to Add/Remove a Single Office
               Program or Component


Additional query words: SR1 release1 8.0 8.00
Keywords : kbfield kbinterop
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbfix kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 15, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.