Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: setting icon(120*40) to SDI Application left corner of the title Pin
Jens Doose21-Jul-03 23:56
Jens Doose21-Jul-03 23:56 
GeneralRe: setting icon(120*40) to SDI Application left corner of the title Pin
Adi Narayana22-Jul-03 0:32
Adi Narayana22-Jul-03 0:32 
GeneralRe: setting icon(120*40) to SDI Application left corner of the title Pin
Jens Doose22-Jul-03 1:28
Jens Doose22-Jul-03 1:28 
GeneralRetrieving Header and Footer using VC++ Pin
adsilva21-Jul-03 23:32
adsilva21-Jul-03 23:32 
GeneralFAQ 8.4 Pin
Andrew Walker22-Jul-03 2:14
Andrew Walker22-Jul-03 2:14 
GeneralRe: FAQ 8.4 Pin
Ryan Binns22-Jul-03 5:41
Ryan Binns22-Jul-03 5:41 
GeneralRe: FAQ 8.4 Pin
Andrew Walker22-Jul-03 5:43
Andrew Walker22-Jul-03 5:43 
GeneralRe: Retrieving Header and Footer using VC++ Pin
David Crow22-Jul-03 4:57
David Crow22-Jul-03 4:57 
I used this with Word 2000. It should get you close:

CString         strFileName,
                strText;
_Application    app;
Documents       docs;
_Document       doc;
Sections        secs;
Section         sec;
HeadersFooters  headers,
                footers;
HeaderFooter    header,
                footer;
Range           rng;
COleVariant     vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
                vtFalse((short) FALSE),
                vtTrue((short) TRUE),
                vtDoc((short) 0),
                vtText((short) 2),
                vtRtf((short) 6),
                vtHtml((short) 8);


if (app.CreateDispatch("Word.Application") == TRUE)
{
    strFileName = "MyFile.doc";

    docs = app.GetDocuments();

    doc = docs.Open(COleVariant(strFileName), vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional);


    secs = doc.GetSections();

    if (secs.GetCount() > 0)
    {
        for (long lSection = 1; lSection <= secs.GetCount(); lSection++)
        {
            TRACE("Section %ld\n", lSection);

            sec = secs.Item(lSection);

            headers = sec.GetHeaders();

            if (headers.GetCount() > 0)
            {
                for (long lHeader = 1; lHeader <= headers.GetCount(); lHeader++)
                {
                    header = headers.Item(lHeader);

                    rng = header.GetRange();

                    strText = rng.GetText();

                    TRACE("  Header %ld Text = ]%s[\n", lHeader, strText);
                }
            }

            footers = sec.GetFooters();

            if (footers.GetCount() > 0)
            {
                for (long lFooter = 1; lFooter <= footers.GetCount(); lFooter++)
                {
                    footer = footers.Item(lFooter);

                    rng = footer.GetRange();

                    strText = rng.GetText();

                    TRACE("  Footer %ld Text = ]%s[\n", lFooter, strText);
                }
            }
        }
    }

    docs.Close(vtFalse, vtOptional, vtOptional);

    app.Quit(vtOptional, vtOptional, vtOptional);
}

GeneralRe: Retrieving Header and Footer using VC++ Pin
adsilva25-Jul-03 19:20
adsilva25-Jul-03 19:20 
GeneralProblem with more than one dialog box.. Pin
Deepak Samuel21-Jul-03 23:30
Deepak Samuel21-Jul-03 23:30 
GeneralRe: Problem with more than one dialog box.. Pin
tcss21-Jul-03 23:42
tcss21-Jul-03 23:42 
GeneralRe: Problem with more than one dialog box.. Pin
Cedric Moonen21-Jul-03 23:44
Cedric Moonen21-Jul-03 23:44 
GeneralRe: Problem with more than one dialog box.. Pin
Deepak Samuel22-Jul-03 0:19
Deepak Samuel22-Jul-03 0:19 
GeneralRe: Problem with more than one dialog box.. Pin
jhwurmbach22-Jul-03 0:10
jhwurmbach22-Jul-03 0:10 
GeneralRe: Problem with more than one dialog box.. Pin
Deepak Samuel22-Jul-03 0:12
Deepak Samuel22-Jul-03 0:12 
GeneralRe: Problem with more than one dialog box.. Pin
jhwurmbach22-Jul-03 0:18
jhwurmbach22-Jul-03 0:18 
GeneralControl Key press in clistview Pin
tcss21-Jul-03 23:27
tcss21-Jul-03 23:27 
GeneralRe: Control Key press in clistview Pin
Adi Narayana22-Jul-03 0:36
Adi Narayana22-Jul-03 0:36 
GeneralRe: Control Key press in clistview Pin
tcss22-Jul-03 0:45
tcss22-Jul-03 0:45 
Generalpaige32.dll PBM Pin
RaajaOfSelf21-Jul-03 23:14
RaajaOfSelf21-Jul-03 23:14 
GeneralListCtrl and line break Pin
heju21-Jul-03 22:48
heju21-Jul-03 22:48 
Questionhow to use control Pin
ladder21-Jul-03 22:36
ladder21-Jul-03 22:36 
AnswerRe: how to use control Pin
BirJas21-Jul-03 23:22
BirJas21-Jul-03 23:22 
GeneralRe: how to use control Pin
ladder22-Jul-03 23:47
ladder22-Jul-03 23:47 
AnswerRe: how to use control Pin
El'Cachubrey21-Jul-03 23:38
El'Cachubrey21-Jul-03 23:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.