In Microsoft Word you can do very cool stuff using Field Codes (Formulas). For example you could create a condition to show a Picture and with a few of them you’ll have a nice Picture Randomizer for your Document Header and Footer.
After you finished such an amazing Field Code you probably want to reuse it in other Documents but ran into some issues. Even in small documents Microsoft Word might become not responding, show totally or partially blank Pages or other strange display Issues. I’ll explain you what it causes and how to work around it.
The cool thing
We created a Word Template which looks similar to this simplified one:
That’s quite cool but requires no Macro! The Field Codes are like:
{ IF { =MOD({ PAGE }; 3 } = 0 { INCLUDEPICTURE „C:\\Letterhead\Blue.png“ } }
The ugly thing
If you use Word 2010 and copy and paste these to another document it looks ok for the first moment. But as soon as people start to work with it, they might get these issues:
The document looks wrong when you scroll, zoom in/out or type. During that the CPU usage might be very high which indicates a performance issue. If you Press ALT + F9 to Toggle the Field Codes you’ll see there’s something wrong:
Word 2010 just replaces the INCLUDEPICTURE Code with the actual picture which causes that issues.
The fix
To fix this issue you can either write the Formula again and again in Word 2010. Paste alternate didn’t work for us.
Or you can use Word 2013 where Copy and Paste works as expected. You can then save the File again as Word 2010 Document (check Maintain compatibility with previous versions of Word).
Attention
If you use Word 2013 (or maybe Word 2015) and open an older Word Document in Compatibility Mode, ensure to save it with Maintain compatibility with previous versions of Word checked. If you don’t you get a warning about “some minor layout changes are possible”. If you ignore that, you run into the same issue that INCLUCEPICTURE gets changed after saving!
PS: if you check “Do not ask me again” you can’t undo this in any settings. It’s stored binarily in the Windows Registry at HKCU\Software\Microsoft\Office\15.0\Word. Just rename or remove that key.
Hi there,
I was so glad when I found this page. Thus I finally got the explanation what is going wrong with our Word documents here.
So +1 for pointing out this issue.
For the fix: I was not satisfied with the work-arounds provided here and started digging by myself. In the end I found a Word 2010 work-around that I would like to share here:
You can „Insert“ an „Object“ as a „Bitmap Image“ which opens a MS Paint instance where you can paste your image. The code { EMBED Paint.Picture } and the result work just fine within headers and footers.
Kind regards
Strix