Skip to content

TextInfo in MSWord doesn't provide formatting information #16171

@mltony

Description

@mltony

Steps to reproduce:

  1. Create a new MS Word document and type the following text:
This is a bold word.
  1. Select the word "bold" and press Control+B to mark it bold. NVDA speaks "bold on".
  2. Optionally verify by pressing NVDA+F that the word indeed turned bold.
  3. Press Home to move the cursor to the very beginning of the document.
  4. Press NVDA+space to enter browse mode.
  5. Open NVDA Python Console by pressing NVDA+control+z and type:
>>> t = focus.treeInterceptor.makeTextInfo('caret')
>>> t.expand('paragraph')
>>> ff = t.getTextWithFields()
>>> ff[5]
'bold '
>>> ff[4]
FieldCommand formatChange with {'language': 'en_US', 'page-number': '1'}

Actual behavior:

As can be seen in python output, formatChange command immediately preceding the word "bold" doesn't contain any information suggesting that the text is actually bold.

Expected behavior:

TextInfo.getTextWithFields() should return correct formatting information. In particular, ff[4] should contain dict entry 'bold': True, among others.

NVDA logs, crash dumps and other attachments:

N/A

System configuration

NVDA installed/portable/running from source:

Running from dist.

NVDA version:

master

Windows version:

Windows 10

Name and version of other software in use when reproducing the issue:

MSWord 16.0.17029.20140
This issue reproduces with both UIA enabled and disabled. When UIA disabled indices in ff are going to be different, but the problem is the same: formatChange field immediately preceding the word "bold" doesn't contain 'bold': True entry - as well as all other formatting information seems to be missing.

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions