Formatting .ICS files (and WEIRD formatting rules too!)

Blog Post created by 61ca0ed3c04e3dbc09673376abaaf7e880b3f95d Employee on Mar 15, 2017

I haven't had a case on this in quite some time, so I was a little bit excited to get a "My Calendar file is doing something WEIRD!" case.


Here's the thing with .ICS and calendar files, they are incredibly simple creatures, they don't have any way of holding font/formatting, etc. As a result, Outlook looks for specific things to control the look and feel of things in the description area.


This can result in unintentionally hilarious results:

One of the key things it looks for is a colon followed by a hard enter. Anything following :

Ends up being bolded and blue.


The only way to fix it is to go back to the "hilarious results:" and change it to something else, say "hilarious results -" that would be fine.

So if you have a line in your ICS that says "Phone:" followed by a hard enter... yup. Bold and blue. You can also "escape" characters by preceding them with a backslash so \: would work as well.


If the first line of your ICS file starts with a capital letter, it will think you're trying to make it a header and make it also bold and blue.

BUT - If the first line ENDS with a punctuation mark, it will be treated normally and be read as text.


So Line 1: "Welcome to our Webinar"

vs. Line 1: "Welcome to our Webinar!"



There's another way that ICS files

Will trigger header formatting:

It has to do with line breaks.


Because .ICS files are just plain text files, line breaks are stored by a special character of \n (for "New Line"). If you have two line breaks in a row (\n\n), followed by 3 or more lines of text, again, it thinks you're typing header information and again, it converts to bold and blue. You can fix this by downloading the ICS file, saving it to your computer and editing it with a text editor like Notepad. You should be able to immediately see the \n\n characters and be able to fix it.


The case that popped up today which triggered this whole memory chain was involving my tokens. Back in the day there was a bug in emails where if you had multiple {{my.tokens}} in use, but one of them was typed wrong it would prevent ALL tokens from rendering in the email, not just the one that was bad. We fixed that, which is great! But it looks like the bug is still present in the calendar file rendering.


So if your description contains:






That will actually cause all 3 to fail, because it's token#3 not tokne#3. Correcting that one typo will make all three tokens work.


There really isn't a good repository of all the .ICS tips and tricks, these are just the ones I have encountered, I'm sure there are many, many more than this. If you know of other good examples, please feel free to list them in the comments!

Is this article helpful ?