One of my current Visio VSTO add-in projects requires me to react to users pasting custom shapes in the Visio page from the clipboard. The process involves registering the ExitScope event and then checking the Clipboard contents. Initially, I was merely testing for a line in the DataObject that started with the word “Visio “, but then testing revealed that copying and pasting text from one shape to another was also getting processed, so then I added a further check that the line also finished with the word ” Shapes”. This works fine, but then I got to wonder if I could also post-process tables copied and pasted from Excel because the standard paste maintains font settings but omits the tabs and line feeds, making the text unusable without serious manual editing. This article explains how this can done.


















