首页 文章

Outlook超链接的格式是什么?

提问于
浏览
2

我正在使用一个实用程序来获取一些(~80)超链接并将它们转换为可以粘贴到Outlook电子邮件中的格式 - 导致Outlook仅显示链接的URL中的参数 . 我们的错误跟踪系统中的超链接实际参考错误 . 超链接仅因URL末尾的错误编号参数而异 . 我的计划是让实用程序在剪贴板上推送Outlook格式的超链接,以便将它们粘贴到Outlook中 . 我遇到的问题是: what is the format that Outlook expects to paste the hyperlinks in as described--with a single bug number as the visible text for the link? 作为参考,我打算用Python做这一切 .

1 回答

  • 2

    不确定python implementation,但在c#中,您可以使用 System.Windows.Forms.Clipboard 复制富文本编辑器的HTML格式文本 . 见related SO postHTML Clipboard Format on MSDN . 也许使用this reference link - 您可以将其转换为基于python的方法 .

    private const string html = @"Version:0.9
    StartHTML:<<<<<<<1
    EndHTML:<<<<<<<2
    StartFragment:<<<<<<<3
    EndFragment:<<<<<<<4
    SourceURL: {0}
    <html>
    <body>
    <!--StartFragment-->
    <a href='{0}'>{1}</a>
    <!--EndFragment-->
    </body>
    </html>";
    
    string link = String.Format(html, "http://www.stackoverflow.com", "StackOverflow");
    Clipboard.SetText(link, TextDataFormat.Html);
    

相关问题