Comments (6)
Thanks, Cindy. We're looking into this. (Wondering why we have both a getById and a getItem.)
from office-js-docs-reference.
Hi Rick - Yes, I was wondering why, as well... Didn't trust myself to ask Juan, though At first, I thought they might be from different api sets, but I see both are 1.1.
from office-js-docs-reference.
I'm transferring this to office-js because its a bug in ContentControlCollection.getItem()
. It should take the index of the CC in the collection, but instead it takes the ID of the CC. There's already a getByID()
method that does this.
from office-js-docs-reference.
@Rick-Kirkham : @cindymeister is right, the documentation is misleading. This one needs to be modified.
and now to add more details.
- the getItem methods in Office.js universally get an item within the collection by ID. This is true in Word and in Excel. In the documentation we INCORRECTLY say its by Index.
- The getItemAt methods in Office.js are the ones used for getting an item by its position in the collection. Given that in some conditions for content controls is very confusing in Word to determine order, we did not implemented this method for the contentControls collection.
- In the case of Word it was, effectively, not needed since we already have a getByID method on the control collection, at the time we only added this method to be consistent with the rest of the API.
- Finally getItem, as Cindy refers DO work with content control IDs, who happen to [ultimately] be numbers. (and read only). They are automatically assigned by Word and cannot be changed programmatically. We handle this different than in the COM API, although there is also a "stringified" number.
Bottom line I am assigning back to Ricky to update the docs!
Thanks @cindymeister !
-Juan.
from office-js-docs-reference.
Looks like there was some internal miscommunication about this issue. I've transferred it back to the reference documentation repo.
from office-js-docs-reference.
This is fixed in the source file. Several other Collection classes in Word and Excel needed the same fix. The process of publishing a fixed API description for the Rich APIs is longer than for Common APIs, but I believe the fix should be published in the next couple of weeks.
from office-js-docs-reference.
Related Issues (20)
- OfficeJS Word > Building Blocks HOT 1
- Excel.LocalImageCellValueCacheId doesn't explain how to retreive image from cache HOT 1
- Office Add-ins manifest Outlook HOT 3
- Help in Manifest.xml HOT 5
- is that possible to set set Signature Default from add-in HOT 8
- Request for Information on Upcoming Feature Releases for Mailbox HOT 2
- Office.DevicePermissionType.microphone is undefined HOT 3
- How to set CustomProperty and recognize emails generated with displayNewMessageFormAsync in an Outlook add-in? HOT 3
- Loading Text Length HOT 3
- Property 'isAllDayEvent' does not exist on type 'AppointmentCompose'.ts(2339) HOT 2
- Information on "addHandlerAsync" for "onMessageSend" in Office.js HOT 5
- Detect New Emails with Office.js in Outlook Add-ins HOT 2
- Reporting Issues or Bugs with OfficeJS HOT 1
- 请问如何在右键邮件是添加Menu HOT 2
- Example not relevant anymore HOT 4
- Positioning Your Add-In in the Same Location as "Viva Insights" in Microsoft Outlook HOT 1
- typeerror: cannot read properties of undefined (reading 'microphone') HOT 1
- how to show two buttons in notification message HOT 2
- Incomplete and incorrect information on new `inReplyTo` property of `Office.MessageCompose` HOT 8
- How to unprotect/Protect a document usin Office JS API. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from office-js-docs-reference.