Macro to extract code blocks from CodeBlock objects