Embedded files & OneNote section file size

I love getting emails from readers of the blog, it is great to hear from so many of you.  Of course I don't always get time to reply to them promptly but I do read them.  I was going through some emails from the past few weeks and I saw this question:

I noticed that if I embed a file into a page, OneNote stores a copy of it in the .one file. So if I embed a movie that is 20mb, the .one file increases by 20mb. That's fine... but if I delete the embedded movie from the page, the file size does NOT decrease by 20mb.

Why doesn't it realize that I deleted the movie and decrease the file size? What can I do?

This a great question and it has to do with how OneNote optimizes the section files.  I wrote about this awhile ago:  A teaser on how OneNote storage and replication works and I will try and explain more here.  When you remove the 20meg embedded file it isn't removed right away, the reference to it is removed but the content is still there.  Later OneNote will optimize the file which will remove the actual file and make your section file size decrease by 20megs.  If you need to run optimize right now you can do so:

  1. Make sure that notebook is open in OneNote
  2. Tools-->Options
  3. Choose “Save”
  4. Click on “Optimize All Files Now”
  5. Done!

This should remove any leftover data that was in the file which otherwise would have been removed on idle.