Microsoft KB Archive/130196

WD: Converted ASK & SET Fields Don’t Retain Character Formatting

PSS ID Number: Q130196 Article last modified on 05-18-1999

MACINTOSH:5.x

MACINTOSH

================================================================ ==

The information in this article applies to:

 == Microsoft Word for the Macintosh, versions 5.x == 

= SYMPTOMS =

In Microsoft Word 6.x and later, if you open a Word 5.x for the Macintosh document containing ASK or SET merge instructions, direct formatting applied to the fields that reference the ASK and SET statements is initially retained. However, if you subsequently update the fields, the original character formatting is lost.

= CAUSE =

By default, in Word 5.x for the Macintosh, the formatting of the reference field is determined by how the reference field is formatted. In contrast, in Word 6.x and later, the formatting of the reference field is determined by the formatting applied to what it references.

= WORKAROUND =

To force Word 6.x and later to retain the original direct character formatting applied to these fields, add the *charformat switch to the affected fields. The following macro adds this switch to all fields within a converted file, assuring that the fields retain their formatting.

Microsoft provides programming examples 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. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/supportnet/refguide/

In Microsoft Word 6.x and 7.x
Sub MAIN ViewFieldCodes 1 StartOfDocument EditFind .Find = “^d”, .Direction = 0, .MatchCase = 0, .WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, .Format = 0, .Wrap = 0 While EditFindFound CharRight 1 CharLeft 1 Insert “* charformat” RepeatFind Wend ViewFieldCodes 0 End Sub

In Word 98 Macintosh Edition and Word 97 for Windows
Sub Main Dim myfield As Object For Each myfield In ActiveDocument.Fields If myfield.Type = wdFieldRef Then myfield.Code.Text = myfield.Code.Text & &quot; *charformat &quot; End If Next End Sub

= STATUS =

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

= MORE INFORMATION =

To maintain upward compatibility and functionality, Word 5.x for the Macintosh ASK and SET instructions are converted to Word ASK and SET fields in Word 6.x and later. Fields that references these SET and ASK fields are converted to REF fields.

The behavior referenced above only affects documents containing these merge codes opened from Word 5.x for the Macintosh into Word 6.x and later. It does not affect fields in new documents created in Word 6.x and later.

Additional query words: conversion convert converted converts converting translation translate translated translates translating transfer transferred transfers transferring ====================================================================== Keywords : kbinterop kbfield macword Version : MACINTOSH:5.x Platform : MACINTOSH Issue type : kbhowto ============================================================================= Copyright Microsoft Corporation 1999.