Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

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

pdf - making microsoft word buttons inside document that can run javascript

Is it possible to create buttons inside a word document that can run JavaScript code? somewhat similar to running VBA code like:

Private Sub CommandButton1_Click()
    MsgBox "hello world"
End Sub

I want to make a button that will still work after the document is exported as a PDF. Like in this tutorial: http://www.lystech.com/webhelp/Content/calculate-in-pdf/ They are using CenoPDF, but I was hoping to find another way to do this on my own. I tried reading about Office JavaScript API, but couldn't find something relevant.

question from:https://stackoverflow.com/questions/65599125/making-microsoft-word-buttons-inside-document-that-can-run-javascript

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

1 Answer

0 votes
by (71.8m points)

Embedding scripts to a native object is not supported via. Office-js. If you are looking for cross-app scenarios (Word and PDF), I don't think it's possible through the JavaScript solutions that Office-js/add-ins offer. I can't think of an alternate solution either.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...