Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

openxml - writing my first customXMLpart for a Word add-in in javascript

I've managed to create my first Word add-in that grabs a formatted reference/citation pair from an external server (wikindx) to insert into Word.

WIKINDX add-in

CLicking on 'Insert Citation, the citation/reference pair is inserted in the Word document. External databases can be added/edited/deleted and search results can be formatted to whatever bibliographic styles exist on the external server.

So far so good. . .

However, this is just basic copy 'n' paste stuff – the formatting of citations and references is a lot more complex and there's a fair bit of processing required on the finished document that can only take place once all citations have been inserted. I'm working towards an add-in where the user inserts citations, then finalizes the document's citations by clicking on the add-in. To do this, each time a citation is inserted, I need to insert various elements:

  1. Two items of visible text – the in-text citation (e.g. '(Author, year')) and the reference at the end of the document (this I can now do).
  2. A hidden element wrapping the in-text citation that contains a unique ID referencing an ID on the external server (this I cannot yet do).

I have a feeling this is something to do with Custom XML Parts but I cannot make any headway using the minimal examples (usually in C#) that I've found. I'm using javascript in VisualStudio.

I would love to get my hands on a simple (i.e. can be understood and hacked by someone more used to PHP) javascript example that: a) creates and inserts a custom field with custom data and unique ID b) reads back and (for now) prints to the console.log each custom field and its data.

Thanks in advance for any help.

question from:https://stackoverflow.com/questions/66066001/writing-my-first-customxmlpart-for-a-word-add-in-in-javascript

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...