May 06 2024 04:44 AM - edited May 06 2024 04:46 AM
Hi,
I am working on Word add-in where I am able to set placeholder text for content control without any character limit but when I am trying to get the placeholder text using office JS methods, then it is returning only the first 255 characters string.
If the same is set on content control object then the collection must return the whole text of the placeholder.
Please provide a support for this issue as soon as possible.
Code snippet :-
Word.run((context) => {
const range = context.document.getSelection();
// Insert a content control at the selection range
const contentControl = range.insertContentControl();
// Set the placeholder text for the content control
contentControl.placeholderText = "indiaaaaaaaaaaaaaaadsf asd fsdf[a]sd [fa]sd [fa]sd[ fa]sd f{}{}asd fsda:;asdfa sdf asd fasd asd fdfasd f@3323 q4q234q34dfasdf asd fasdf asd fasd fasd fasdf asd as fasd asdf asd asd fasdf asdf asd asd fasd fasd fasd asd sdafindiaaaaaaaaaaaaaaadsf asd fsdf[test test"
// Load the changes made to the document
return context.sync()
.then(() => {
console.log("Content control inserted with placeholder text:", contentControl.placeholderText); // returning only first 255 characters
});
})
.catch((error) => {
console.error("Error: " + JSON.stringify(error));
});