Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Printing to Excel

, 20 Apr 2002
This article shows how to send data to Excel instead of a printer.
testexcel.zip
testexcel
res
TestExcel.ico
TestExcelDoc.ico
Toolbar.bmp
TestExcel.dsp
TestExcel.dsw
TestExcel.plg
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// Deutsch (Deutschland) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#ifdef _WIN32
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r\n"
    "#ifdef _WIN32\r\n"
    "LANGUAGE 7, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#endif //_WIN32\r\n"
    "#include ""res\\TestExcel.rc2""  // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen\r\n"
    "#include ""l.deu\\afxres.rc""          // Standardkomponenten\r\n"
    "#include ""l.deu\\afxprint.rc""        // Ressourcen f�r Drucken/Seitenansicht\r\n"
    "#endif\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON    DISCARDABLE     "res\\TestExcel.ico"
IDR_TESTEXTYPE          ICON    DISCARDABLE     "res\\TestExcelDoc.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

IDR_MAINFRAME           BITMAP  MOVEABLE PURE   "res\\Toolbar.bmp"

/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//

IDR_MAINFRAME TOOLBAR DISCARDABLE  16, 15
BEGIN
    BUTTON      ID_FILE_NEW
    BUTTON      ID_FILE_OPEN
    BUTTON      ID_FILE_SAVE
    SEPARATOR
    BUTTON      ID_EDIT_CUT
    BUTTON      ID_EDIT_COPY
    BUTTON      ID_EDIT_PASTE
    SEPARATOR
    BUTTON      ID_FILE_PRINT
    SEPARATOR
    BUTTON      ID_APP_ABOUT
END


/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDR_MAINFRAME MENU PRELOAD DISCARDABLE 
BEGIN
    POPUP "&Datei"
    BEGIN
        MENUITEM "&Neu\tStrg+N",                ID_FILE_NEW
        MENUITEM "�&ffnen...\tStrg+O",          ID_FILE_OPEN
        MENUITEM "S&peichern\tStrg+S",          ID_FILE_SAVE
        MENUITEM "Speichern &unter...",         ID_FILE_SAVE_AS
        MENUITEM SEPARATOR
        MENUITEM "&Drucken...\tStrg+P",         ID_FILE_PRINT
        MENUITEM "Sei&tenansicht",              ID_FILE_PRINT_PREVIEW
        MENUITEM "Drucker&einrichtung...",      ID_FILE_PRINT_SETUP
        MENUITEM SEPARATOR
        MENUITEM "Letzte Datei",                ID_FILE_MRU_FILE1, GRAYED
        MENUITEM SEPARATOR
        MENUITEM "&Beenden",                    ID_APP_EXIT
    END
    POPUP "&Bearbeiten"
    BEGIN
        MENUITEM "&R�ckg�ngig\tStrg+Z",         ID_EDIT_UNDO
        MENUITEM SEPARATOR
        MENUITEM "&Ausschneiden\tStrg+X",       ID_EDIT_CUT
        MENUITEM "&Kopieren\tStrg+C",           ID_EDIT_COPY
        MENUITEM "E&inf�gen\tStrg+V",           ID_EDIT_PASTE
    END
    POPUP "&Ansicht"
    BEGIN
        MENUITEM "&Symbolleiste",               ID_VIEW_TOOLBAR
        MENUITEM "S&tatusleiste",               ID_VIEW_STATUS_BAR
    END
    POPUP "&?"
    BEGIN
        MENUITEM "Inf&o �ber TestExcel...",     ID_APP_ABOUT
    END
    POPUP "E&xcel"
    BEGIN
        MENUITEM "Send data to Excel",          ID_MENU_EXCEL
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//

IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE 
BEGIN
    "N",            ID_FILE_NEW,            VIRTKEY, CONTROL
    "O",            ID_FILE_OPEN,           VIRTKEY, CONTROL
    "S",            ID_FILE_SAVE,           VIRTKEY, CONTROL
    "P",            ID_FILE_PRINT,          VIRTKEY, CONTROL
    "Z",            ID_EDIT_UNDO,           VIRTKEY, CONTROL
    "X",            ID_EDIT_CUT,            VIRTKEY, CONTROL
    "C",            ID_EDIT_COPY,           VIRTKEY, CONTROL
    "V",            ID_EDIT_PASTE,          VIRTKEY, CONTROL
    VK_BACK,        ID_EDIT_UNDO,           VIRTKEY, ALT
    VK_DELETE,      ID_EDIT_CUT,            VIRTKEY, SHIFT
    VK_INSERT,      ID_EDIT_COPY,           VIRTKEY, CONTROL
    VK_INSERT,      ID_EDIT_PASTE,          VIRTKEY, SHIFT
    VK_F6,          ID_NEXT_PANE,           VIRTKEY 
    VK_F6,          ID_PREV_PANE,           VIRTKEY, SHIFT
END


/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Info �ber TestExcel"
FONT 8, "MS Sans Serif"
BEGIN
    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
    LTEXT           "TestExcel Version 1.0",IDC_STATIC,40,10,119,8,
                    SS_NOPREFIX
    LTEXT           "Copyright (C) 2002",IDC_STATIC,40,25,119,8
    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
END


#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040704B0"
        BEGIN
            VALUE "CompanyName", "\0"
            VALUE "FileDescription", "MFC-Anwendung TestExcel\0"
            VALUE "FileVersion", "1, 0, 0, 1\0"
            VALUE "InternalName", "TestExcel\0"
            VALUE "LegalCopyright", "Copyright (C) 2002\0"
            VALUE "LegalTrademarks", "\0"
            VALUE "OriginalFilename", "TestExcel.EXE\0"
            VALUE "ProductName", "Anwendung TestExcel\0"
            VALUE "ProductVersion", "1, 0, 0, 1\0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x407, 1200
    END
END

#endif    // !_MAC


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 228
        TOPMARGIN, 7
        BOTTOMMARGIN, 48
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE PRELOAD DISCARDABLE 
BEGIN
    IDR_MAINFRAME           "TestExcel\n\nTestEx\n\n\nTestExcel.Document\nTestEx Document"
END

STRINGTABLE PRELOAD DISCARDABLE 
BEGIN
    AFX_IDS_APP_TITLE       "TestExcel"
    AFX_IDS_IDLEMESSAGE     "Bereit"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_INDICATOR_EXT        "ER"
    ID_INDICATOR_CAPS       "UF"
    ID_INDICATOR_NUM        "NUM"
    ID_INDICATOR_SCRL       "RF"
    ID_INDICATOR_OVR        "�B"
    ID_INDICATOR_REC        "MA"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_FILE_NEW             "Erstellt ein neues Dokument.\nNeu"
    ID_FILE_OPEN            "�ffnet ein bestehendes Dokument.\n�ffnen"
    ID_FILE_CLOSE           "Schlie�t das aktive Dokument.\nSchlie�en"
    ID_FILE_SAVE            "Speichert das aktive Dokument.\nSpeichern"
    ID_FILE_SAVE_AS         "Speichert das aktive Dokument unter neuem Namen.\nSpeichern unter"
    ID_FILE_PAGE_SETUP      "�ndert die Druckoptionen.\nSeite einrichten"
    ID_FILE_PRINT_SETUP     "�ndert den Drucker und die Druckoptionen.\nDruckereinrichtung"
    ID_FILE_PRINT           "Druckt das aktive Dokument.\nDrucken"
    ID_FILE_PRINT_PREVIEW   "Zeigt ganze Seiten an.\nSeitenansicht"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_APP_ABOUT            "Zeigt Programm-Informationen, Versionsnummer und Copyright an.\nInfo"
    ID_APP_EXIT             "Verl��t die Anwendung; fragt, ob Dokumente gespeichert werden sollen.\nBeenden"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_FILE_MRU_FILE1       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE2       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE3       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE4       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE5       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE6       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE7       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE8       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE9       "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE10      "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE11      "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE12      "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE13      "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE14      "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE15      "�ffnet dieses Dokument."
    ID_FILE_MRU_FILE16      "�ffnet dieses Dokument."
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_NEXT_PANE            "Wechselt zum n�chsten Fensterausschnitt.\nN�chster Ausschnitt"
    ID_PREV_PANE            "Springt zum vorherigen Fensterausschnitt zur�ck.\nVorheriger Ausschnitt"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_WINDOW_SPLIT         "Teilt das aktive Fenster in Ausschnitte.\nTeilen"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_EDIT_CLEAR           "L�scht die Markierung.\nL�schen"
    ID_EDIT_CLEAR_ALL       "L�scht alles.\nAlles l�schen"
    ID_EDIT_COPY            "Kopiert die Markierung und �bertr�gt sie in die Zwischenablage.\nKopieren"
    ID_EDIT_CUT             "Entfernt die Markierung und �bertr�gt sie in die Zwischenablage.\nAusschneiden"
    ID_EDIT_FIND            "Sucht den angegebenen Text.\nSuchen"
    ID_EDIT_PASTE           "F�gt den Inhalt der Zwischenablage ein.\nEinf�gen"
    ID_EDIT_REPEAT          "Wiederholt die letzte Aktion.\nWiederholen"
    ID_EDIT_REPLACE         "Ersetzt einen bestimmten Text durch einen anderen.\nErsetzen"
    ID_EDIT_SELECT_ALL      "Markiert das gesamte Dokument.\nAlles markieren"
    ID_EDIT_UNDO            "Macht die letzte Aktion r�ckg�ngig.\nR�ckg�ngig"
    ID_EDIT_REDO            "Wiederholt die vorher r�ckg�ngig gemachte Aktion.\nWiederherstellen"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_VIEW_TOOLBAR         "Blendet die Symbolleiste ein oder aus.\nSymbolleiste ein-/ausschalten"
    ID_VIEW_STATUS_BAR      "Blendet die Statusleiste ein oder aus.\nStatusleiste ein-/ausschalten"
END

STRINGTABLE DISCARDABLE 
BEGIN
    AFX_IDS_SCSIZE          "�ndert die Fenstergr��e."
    AFX_IDS_SCMOVE          "�ndert die Position des Fensters."
    AFX_IDS_SCMINIMIZE      "Verkleinert das Fenster zu einem Symbol."
    AFX_IDS_SCMAXIMIZE      "Vergr��ert das Fenster zu voller Gr��e."
    AFX_IDS_SCNEXTWINDOW    "Wechselt zum n�chsten Dokumentfenster."
    AFX_IDS_SCPREVWINDOW    "Wechselt zum vorherigen Dokumentfenster."
    AFX_IDS_SCCLOSE         "Schlie�t das aktive Fenster und fordert zur Dokumentspeicherung auf."
END

STRINGTABLE DISCARDABLE 
BEGIN
    AFX_IDS_SCRESTORE       "Stellt das Fenster in seiner normalen Gr��e wieder her."
    AFX_IDS_SCTASKLIST      "Aktiviert die Task-Liste."
END

STRINGTABLE DISCARDABLE 
BEGIN
    AFX_IDS_PREVIEW_CLOSE   "Beendet die Seitenansicht.\nSeitenansicht beenden"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_MENU_EXCEL           "Send data to Excel"
END

#endif    // Deutsch (Deutschland) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
#ifdef _WIN32
LANGUAGE 7, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\TestExcel.rc2"  // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen
#include "l.deu\afxres.rc"          // Standardkomponenten
#include "l.deu\afxprint.rc"        // Ressourcen f�r Drucken/Seitenansicht
#endif

/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 21 Apr 2002
Article Copyright 2002 by Franz Maerzinger
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid