OfficeExtension.TrackedObjects class
Collection of tracked objects, contained within a request context. See context.trackedObjects for more information.
Methods
add(object) | Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. If this object is part of a collection in Word, you should also track the parent collection. |
add(objects) | Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. If this object is part of a collection in Word, you should also track the parent collection. |
remove(object) | Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the Office application, so please remember to free any objects you add, once you're done using them. You will need to call |
remove(objects) | Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the Office application, so please remember to free any objects you add, once you're done using them. You will need to call |
Method Details
add(object)
Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. If this object is part of a collection in Word, you should also track the parent collection.
add(object: ClientObject): void;
Parameters
- object
- OfficeExtension.ClientObject
Returns
void
add(objects)
Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. If this object is part of a collection in Word, you should also track the parent collection.
add(objects: ClientObject[]): void;
Parameters
- objects
Returns
void
remove(object)
Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the Office application, so please remember to free any objects you add, once you're done using them. You will need to call context.sync()
before the memory release takes effect.
remove(object: ClientObject): void;
Parameters
- object
- OfficeExtension.ClientObject
Returns
void
remove(objects)
Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the Office application, so please remember to free any objects you add, once you're done using them. You will need to call context.sync()
before the memory release takes effect.
remove(objects: ClientObject[]): void;
Parameters
- objects
Returns
void
Office Add-ins