Skip to content
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
Closed

Support for form fields in Microsoft Word #2295

nvaccessAuto opened this issue May 3, 2012 · 16 comments
Milestone

Comments

@nvaccessAuto
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@nvaccessAuto
Copy link
Author

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

@nvaccessAuto
Copy link
Author

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

@nvaccessAuto
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Projects
None yet
Development

No branches or pull requests

1 participant