Open qingfusheng opened 6 months ago
Thanks for asking about this. We've added this to our documentation backlog (internal item 8843657).
Regarding item 2, see if fields do what you need (maybe FieldType Ref?). The actual field type likely depends on what type of reference you insert - consider trying various types in the Word UI to see what field type is set. There are restrictions with using fields (see the Remarks for Word.Range.insertField).
Regarding item 3, we have List examples showing level numbering (e.g., Word.List.setLevelNumbering). You should be able to apply this to paragraphs using heading styles.
Let us know whether or not this helped, or if you have further questions.
We still need to investigate item 1.
Thanks.
Thank you very much for your response, sincerely.
Regarding the second question, thank you for your explanation. I have successfully created a bookmark and used the InsertField function to insert a reference, which has been very helpful for me.
As for the third question, my scenario involves adding styles for first, second, and third level headings in the Word Style pane (Home → Styles). This will involve automatic numbering of styles. However, upon examining the properties of Style and Style.ParagraphFormat, I found that the properties related to lists are read-only. The Paragraph class does have a startNewList() function, but I'm unsure if this will help with my requirement because what I need is to set numbering properties for Style.
@qingfusheng For item 1, can you provide some more details about this, including one or two examples of formats that require 2 fonts at the same time? Thanks.
Regarding to item1, it may be used in Chinese writing, especially when the content contains both Chinese and English, and the formats for both Chinese and English fonts are specified separately. In Word applications, applying Chinese fonts first and then English fonts may solve the problem. I want to incorporate this requirement into the style Editing, so it may be necessary to specify both Chinese and English fonts simultaneously. (Style editing in Word applications supports simultaneous editing of both Chinese and English fonts)
Hi @qingfusheng Thanks for your clarification. I'm transferring this to the product repo office-js for the feature crew to take a look.
Thanks.
@shanshanzheng-dev Can you take a look? Thanks.
@qingfusheng Hi, Word.Style(https://learn.microsoft.com/en-us/javascript/api/word/word.style?view=word-js-preview) APIs just provide to set single font. If you have this need, we would like to suggest you go to https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform to ask a new question. Feature requests on it are considered when we go through our planning process.
Describe your scenario Word Web Addin,Word Javascript API Preview,Office2019,版本号2402,17328.20184
What is the problem to solve?