# Link to Ignition Project, MS Office formatted Hyperlink?

**URL:** <https://forum.inductiveautomation.com/t/link-to-ignition-project-ms-office-formatted-hyperlink/22978>\
**Category:** General Discussion\
**Created:** [February 28, 2019, 8:03pm UTC](https://forum.inductiveautomation.com/t/link-to-ignition-project-ms-office-formatted-hyperlink/22978 "2019-02-28T20:03:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dano38291](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dano38291](https://forum.inductiveautomation.com/u/dano38291)\
**Post date:** [February 28, 2019, 8:03pm UTC](https://forum.inductiveautomation.com/t/link-to-ignition-project-ms-office-formatted-hyperlink/22978/1 "2019-02-28T20:03:56Z")

</div>

Hi,

I am generating an Ignition Project Link from inside a project to allow other users to get back to a Specific Date Time. So the Ignition Project link with 3 parameters is massively long. I am hoping someone knows the underlying “Clipboard Syntax” for nicely formatted MS Office Hyperlinks(I can create a hyperlink in Word and paste into OneNote, the Display Text and Underlying Link remain across Office Applications). I am just trying to create the MS Office compatible Hyperlink from a button inside of Ignition. I can generate a Project Link, copy to Clipboard and pass in Parameters no Problem, I just want my users to be able to paste a “nice looking” link instead of my massive Project Link.

When I get home I plan to install a “Clipboard Inspector”? I should be able to figure out whats stored on clipboard as I copy a link from Word to Outlook or OneNote.

---

<div class="post-metadata">

**Author:** ![dano38291](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dano38291](https://forum.inductiveautomation.com/u/dano38291)\
**Post date:** [March 1, 2019, 3:47pm UTC](https://forum.inductiveautomation.com/t/link-to-ignition-project-ms-office-formatted-hyperlink/22978/2 "2019-03-01T15:47:11Z")

</div>

I thinking I am going to have to get involved with HTML Dataflavors.  
[https://docs.oracle.com/javase/7/docs/api/java/awt/datatransfer/DataFlavor.html](https://docs.oracle.com/javase/7/docs/api/java/awt/datatransfer/DataFlavor.html)  
[https://docs.oracle.com/javase/tutorial/uiswing/dnd/dataflavor.html](https://docs.oracle.com/javase/tutorial/uiswing/dnd/dataflavor.html)

I could manipulate clipboard with a Clipboard Viewer tool and push HTML format back to clipboard. Just need to learn about Java DataFlavors and push HTML to clipboard instead of just string data.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 1, 2019, 4:26pm UTC](https://forum.inductiveautomation.com/t/link-to-ignition-project-ms-office-formatted-hyperlink/22978/3 "2019-03-01T16:26:57Z")

</div>

Without knowing too much about the office stuff, you’re probably on the right track. I believe most office stuff is wrapped up HTML/XML on the backend, so you’d just have to get it into the right format. You may be able to find someone else’s example in some other program to get the right format, but good luck (I didn’t have any).

On the dataflavor/clipboard stuff - yes, you’ll need to implement a custom class in Jython that implements the Java [`Transferable`](https://docs.oracle.com/javase/8/docs/api/java/awt/datatransfer/Transferable.html) interface; that’s what will do the actual translation of “thing in Ignition” into “HTML on the clipboard”. I have a (somewhat overkill for your needs) example of implementing the `Transferable` interface here: [PDF report linking](http://forum.inductiveautomation.com/t/pdf-report-linking/18860/2?u=pgriffith)

---

<div class="post-metadata">

**Author:** ![dano38291](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dano38291](https://forum.inductiveautomation.com/u/dano38291)\
**Post date:** [March 16, 2019, 2:16pm UTC](https://forum.inductiveautomation.com/t/link-to-ignition-project-ms-office-formatted-hyperlink/22978/4 "2019-03-16T14:16:55Z")

</div>

Took a little bit of reading but I learned about DataHandler appears to implement Transferable.  
[https://docs.oracle.com/javase/8/docs/api/javax/activation/DataHandler.html](https://docs.oracle.com/javase/8/docs/api/javax/activation/DataHandler.html)  
I guess the “internet” is still in Ignition just need to know which Java Library to import?

```auto
def putHTMLStringToClipboard(html_str):
    from javax.activation import DataHandler
    from java.awt import Toolkit
    from java.io import InputStream, ByteArrayInputStream
    cb = Toolkit.getDefaultToolkit().getSystemClipboard()
    ba = ByteArrayInputStream(html_str)
    dh = DataHandler(ba,"text/html")
    cb.setContents(dh, None)
    
putHTMLStringToClipboard('<a href="http://www.google.com">google</a>')

```

original source from attempting to learn about Dataflavors and implementing Transferable  
I guess this Sikuli software uses Jython as well(probably could automate testing my Ignition clients with Sikuli)  
[https://answers.launchpad.net/sikuli/+question/248307](https://answers.launchpad.net/sikuli/+question/248307)  
[http://sikulix.com/#home1](http://sikulix.com/#home1)
