Include formatting information to clipboard clipboard for pasting in Excel

My application writes tabular data to the Windows copy buffer so that the user can paste it into Excel. This is great for unformatted tabular data, including tabs and newlines for cell and row labels.

I would like to include formatting data in the copy buffer: grid lines, background colors, etc. Can I do this, and if so, where can I find a specification for encoding formatting data?

+7
source share
1 answer

Yes, it is possible (obviously, you can copy formatted Excel data from one running Excel instance to another through the clipboard, so it should be possible!)

Remember that the Windows clipboard can store things in several formats at once. The format you want for formatted files in Excel format is called BIFF, that is, a binary exchange file format. This is the same format as Excel storing files. Reasonable Source BIFF Documentation is available from Open Office.

Once you figure out the basics of BIFF, you will find that the easiest way to generate the BIFF that you want is to copy the cell model that you want from the Excel spreadsheet and check that it is on the clipboard.

+4
source

All Articles