New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for form fields in Microsoft Word #2295

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

Comments

Projects
None yet
1 participant
@nvaccessAuto

nvaccessAuto commented May 3, 2012

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

This comment has been minimized.

nvaccessAuto commented May 3, 2012

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

This comment has been minimized.

nvaccessAuto commented Jul 25, 2013

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

This comment has been minimized.

nvaccessAuto commented Jul 25, 2013

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

This comment has been minimized.

nvaccessAuto commented Jul 25, 2013

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

This comment has been minimized.

nvaccessAuto commented Jul 26, 2013

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

This comment has been minimized.

nvaccessAuto commented Jul 28, 2013

Comment 8 by Michael Curran <mick@... on 2013-07-28 17:51
In [b516bbb]:

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

This comment has been minimized.

nvaccessAuto commented Jul 30, 2013

Comment 9 by Michael Curran <mick@... on 2013-07-30 07:04
In [3143085]:

MS Word support: add support for newer style form fields (content controls). Re #2295.

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Aug 8, 2013

Comment 11 by Michael Curran <mick@... on 2013-08-08 05:52
In [8d01115]:

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

This comment has been minimized.

nvaccessAuto commented Aug 8, 2013

Comment 12 by Michael Curran <mick@... on 2013-08-08 05:52
In [0f97a66]:

MS Word support: add support for newer style form fields (content controls). Re #2295.

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Aug 8, 2013

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

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Aug 8, 2013

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

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Aug 10, 2013

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

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Aug 24, 2013

Comment 16 by Michael Curran <mick@... on 2013-08-24 22:23
In [b516bbb]:

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

This comment has been minimized.

nvaccessAuto commented Aug 24, 2013

Comment 17 by Michael Curran <mick@... on 2013-08-24 22:23
In [3143085]:

MS Word support: add support for newer style form fields (content controls). Re #2295.

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Aug 24, 2013

Comment 18 by Michael Curran <mick@... on 2013-08-24 22:23
In [5111fc6]:

Merge branch 't2295': support for form fields in MS Word.

Fixes #2295.

Changes:
Removed labels: incubating
State: closed

@nvaccessAuto

This comment has been minimized.

nvaccessAuto commented Nov 26, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment