如何防止:以编程方式创建的 ICS 文件在 Outlook 2007 中变成 HTML 格式

发布于 2024-09-10 00:10:17 字数 639 浏览 3 评论 0原文

我有一个 ASP.NET 应用程序,用于创建 ICS 文件并将其下载给用户。运行良好。在 StackOverflow 的帮助下,我克服了一些 ICS+Outlook 障碍,非常感谢。

但 Outlook 2007 对我的纯文本 ICS 内容进行 HTML 格式设置。所以我会输入这样的内容:(

Training date/time:  
- GMT:  [dateAndTime]  
- Local: [dateAndTime]

我不知道为什么 StackOverflow 将上面的“Training”和“Local”变成蓝色 - 请忽略它。)

...但是当我在 Outlook 中打开 ICS 时,它看起来像这样:

培训日期/时间:

  • GMT:[dateAndTime]
  • 本地:[dateAndTime]

因为我们的一些用户拥有不支持 HTML 的日历/电子邮件工具,所以我必须使用纯文本内容。当 Outlook 为我格式化所有内容时,我对外观的控制力就会大大减弱。 (并且它遵循的规则不清楚。例如,在行尾添加一个空格使其成为标题?)

如何防止这种情况发生?或者至少,是否有某种 Outlook ICS 风格指南,以便我可以有意使用此“功能”?

I have an ASP.NET application that creates and downloads ICS files to the user. It's working fine. With StackOverflow's help, I got past a number of ICS+Outlook hurdles, so thanks.

But Outlook 2007 is HTML-formatting my plain-text ICS content. So I will put in something like this:

Training date/time:  
- GMT:  [dateAndTime]  
- Local: [dateAndTime]

(I don't know why StackOverflow is making "Training" and "Local" blue above - please ignore that.)

...but when I open the ICS in Outlook, it looks like this:

Training date/time:

  • GMT: [dateAndTime]
  • Local: [dateAndTime]

Because some of our users have non-HTML-enabled calendar/email tools, I have to use to plain-text content. When Outlook formats everything for me, I have much less control over the look. (And the rules it follows are unclear. e.g., adding one blank space at the end of a line makes it a heading?)

How do I prevent this from happening? Or at least, is there some kind of Outlook ICS style guide so I can use this "feature" intentionally?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜你已久 2024-09-17 00:10:17

您尝试过使用 X-ALT-DESC 吗?

X-ALT-DESC;FMTTYPE=text/html:<div>Training date/time</div><ul>
 <li>GMT: [dateAndTime]</li><li>Local: [dateAndTime]</li></ul>

这样,您就可以在 DESCRIPTION 中提供正常的“文本”描述,并在 X-ALT-DESC 中提供替代的 html 格式描述。

-道格

Have you tried using X-ALT-DESC?

X-ALT-DESC;FMTTYPE=text/html:<div>Training date/time</div><ul>
 <li>GMT: [dateAndTime]</li><li>Local: [dateAndTime]</li></ul>

That way you can have a normal "text" description in DESCRIPTION and provide an alternate, html-formatted description in X-ALT-DESC.

-Doug

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文