Support for form fields in Microsoft Word #2295

Closed
nvaccessAuto opened this Issue May 3, 2012 · 16 comments

1 participant

@nvaccessAuto

Reported by jfauchon on 2012-05-03 14:18
Hello,

NVDA desn't detect fomfields in Microsoft Word. For examples, check box, combo box, edit box...
ake ths support please.

Thank you.
Can you m
Blocking #3375, #3383

@nvaccessAuto

Comment 1 by jteh on 2012-05-03 23:04
Changes:
Changed title from "NVDA desn't detect formfield in Microsoft Word" to "Support for form fields in Microsoft Word"

@nvaccessAuto

Comment 4 by jteh on 2013-07-25 03:40
Technical:
When a range is inside a text form field, range.formFields doesn't include the field. There are two possible ways to reliably access a form field from a range:
1. Iterate through range.bookmarks: range.document.formFields(bookmark.name)
2. range.end = range.storyLength, then iterate through bookmarks and get the range for each bookmark. If the bookmark range isn't after our range, get its first form field.

WdFieldType enumeration, which includes form field types: http://msdn.microsoft.com/en-us/library/office/bb213727%28v=office.12%29.aspx

statusText should be reported as the name of the field.

Note that this only applies to what Word 2007 calls legacy controls. It looks like the newer form fields don't even show up in the formFields property.

@nvaccessAuto

Comment 5 by jteh on 2013-07-25 04:07
Word 2007 and above have a new implementation called content controls which are completely different to form fields. You access them via range.contentControls. Again, while in a text control, range.contentControls doesn't include the control. If you go back one offset before the control, it does. Unfortunately, they don't use bookmarks either, so I'm not sure how we're going to do this if you're not at the start of the control. I guess we should address this separately.

ContentControl object: http://msdn.microsoft.com/en-us/library/office/bb213727%28v=office.12%29.aspx

@nvaccessAuto

Comment 6 by csm120 (in reply to comment 4) on 2013-07-25 10:04
Well if NVDA could be made to work with the legacy controls via the status Bar that would be great as I do need to use forms that have been created with these legacy controls. I can provide example documents with the type of forms that I use if needed.

Replying to jteh:

Technical:

When a range is inside a text form field, range.formFields doesn't include the field. There are two possible ways to reliably access a form field from a range:

  1. Iterate through range.bookmarks: range.document.formFields(bookmark.name)

  2. range.end = range.storyLength, then iterate through bookmarks and get the range for each bookmark. If the bookmark range isn't after our range, get its first form field.

WdFieldType enumeration, which includes form field types: http://msdn.microsoft.com/en-us/library/office/bb213727%28v=office.12%29.aspx

statusText should be reported as the name of the field.

Note that this only applies to what Word 2007 calls legacy controls. It looks like the newer form fields don't even show up in the formFields property.

@nvaccessAuto

Comment 7 by jteh on 2013-07-26 06:16
Not all form fields have bookmarks. However, we can do: range.end = range.storyLength; range.formFields[0]; then check whether the form field's range starts before our range.

@nvaccessAuto

Comment 8 by Michael Curran <mick@... on 2013-07-28 17:51
In [b516bbb]:
```CommitTicketReference repository="" revision="b516bbb6df8c0083ce845cfb7d0141726814c142"
Microsoft Word support: add support for reporting older style form fields in word documents. Re #2295.

Checkboxes, text input and combo box controls are supported so far. Their existance is announced within reading text, including their role, and state for checkboxes and value for combo boxes. The status text is also included as an inforced name.
Neither bookmarks, or moveEnd(story) was used. Rather instead we expand to paragraph and use the first formField found where the original range is found to be inRange of that formField's range.

@nvaccessAuto

Comment 9 by Michael Curran <mick@... on 2013-07-30 07:04
In [3143085]:
```CommitTicketReference repository="" revision="3143085ca5ceadb4647984c0276da9e2240540d0"
MS Word support: add support for newer style form fields (content controls). Re #2295.

@nvaccessAuto

Comment 11 by Michael Curran <mick@... on 2013-08-08 05:52
In [8d01115]:
```CommitTicketReference repository="" revision="8d01115f077b218a9ab3e08b3c13e542280dd99a"
Microsoft Word support: add support for reporting older style form fields in word documents. Re #2295.

Checkboxes, text input and combo box controls are supported so far. Their existance is announced within reading text, including their role, and state for checkboxes and value for combo boxes. The status text is also included as an inforced name.
Neither bookmarks, or moveEnd(story) was used. Rather instead we expand to paragraph and use the first formField found where the original range is found to be inRange of that formField's range.

@nvaccessAuto

Comment 12 by Michael Curran <mick@... on 2013-08-08 05:52
In [0f97a66]:
```CommitTicketReference repository="" revision="0f97a667b31ac14bdd53907b547c5e56ce5b1d23"
MS Word support: add support for newer style form fields (content controls). Re #2295.

@nvaccessAuto

Comment 13 by jteh on 2013-08-08 06:11
Changes:
Milestone changed from None to next

@nvaccessAuto

Comment 14 by jteh on 2013-08-08 06:14
Changes:
Added labels: incubating

@nvaccessAuto

Comment 15 by jteh on 2013-08-10 08:48
This needs a What's New update.

@nvaccessAuto

Comment 16 by Michael Curran <mick@... on 2013-08-24 22:23
In [b516bbb]:
```CommitTicketReference repository="" revision="b516bbb6df8c0083ce845cfb7d0141726814c142"
Microsoft Word support: add support for reporting older style form fields in word documents. Re #2295.

Checkboxes, text input and combo box controls are supported so far. Their existance is announced within reading text, including their role, and state for checkboxes and value for combo boxes. The status text is also included as an inforced name.
Neither bookmarks, or moveEnd(story) was used. Rather instead we expand to paragraph and use the first formField found where the original range is found to be inRange of that formField's range.

@nvaccessAuto

Comment 17 by Michael Curran <mick@... on 2013-08-24 22:23
In [3143085]:
```CommitTicketReference repository="" revision="3143085ca5ceadb4647984c0276da9e2240540d0"
MS Word support: add support for newer style form fields (content controls). Re #2295.

@nvaccessAuto

Comment 18 by Michael Curran <mick@... on 2013-08-24 22:23
In [5111fc6]:
```CommitTicketReference repository="" revision="5111fc6aad473ea7f933d7aa433eefd8ad935a9a"
Merge branch 't2295': support for form fields in MS Word.

Fixes #2295.

Changes:
Removed labels: incubating
State: closed
@nvaccessAuto

Comment 19 by jteh on 2013-11-26 23:26
Changes:
Milestone changed from next to 2013.3

@nvaccessAuto nvaccessAuto added this to the 2013.3 milestone Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment