Click here to Skip to main content
16,005,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Having Problems with CFileFind Pin
Atlence22-Nov-03 16:07
Atlence22-Nov-03 16:07 
GeneralRe: Having Problems with CFileFind Pin
darkjedisleikas22-Nov-03 16:12
darkjedisleikas22-Nov-03 16:12 
GeneralRe: Having Problems with CFileFind Pin
Anonymous22-Nov-03 16:36
Anonymous22-Nov-03 16:36 
GeneralWord Automation with MFC Pin
Member 54540422-Nov-03 14:33
Member 54540422-Nov-03 14:33 
GeneralRe: Word Automation with MFC Pin
Peter Molnar22-Nov-03 16:25
Peter Molnar22-Nov-03 16:25 
GeneralRe: Word Automation with MFC Pin
Member 54540423-Nov-03 2:25
Member 54540423-Nov-03 2:25 
GeneralRe: Word Automation with MFC Pin
Peter Molnar23-Nov-03 8:28
Peter Molnar23-Nov-03 8:28 
GeneralRe: Word Automation with MFC Pin
Member 54540423-Nov-03 14:55
Member 54540423-Nov-03 14:55 
Peter,
I appreciate the practice you are attempting to let me try, but I'm pressed for tie in this thing. I'm trying to make the code you suggest work, and I will learn from it and then be able to practice. I adapted your code. Here is my version:
COleVariant vTrue((short)TRUE),vFalse((short)FALSE),vOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
//Creates new doc
Documents documents = application.GetDocuments();
_Document document = documents.Add(vOpt,vOpt,&varEmpty,&varEmpty); //First line
Window oWin = application.GetActiveWindow();
Pane oPane = oWin.GetActivePane();
View oView = oPane.GetView();
oView.SetSeekView(wdSeekCurrentPageHeader);
//Second line
Selection oSel = application.GetSelection();
Shapes oShapes = oSel.GetInlineShapes();
oShapes.AddPicture("c:\\Inspec\\LogoInspec.jpg",vFalse,vTrue,vOpt,vOpt,vOpt,vOpt,vOpt);
//**************
Notice I just changed the names of the app and doc objects to match what I already had, and I added &varEmpty paramters to the :
_Document document = documents.Add(vOpt,vOpt,&varEmpty,&varEmpty) because Add does not take 2 arguments where I'm at.

As for the code:
(ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True)
I was aware of the "DifferentFirstPageHeaderFooter = True"..but as I said, can't quite figure out how to set it up...since you are starting from the ative document,then page setup objects, and from the functions available in the PageSetup class , I guess I would have to use the :
void PageSetup::SetDifferentFirstPageHeaderFooter(long nNewValue)
function. So, here goes:

PageSetup pageSetup;
pageSetup.SetDifferentFirstPageHeaderFooter(TRUE);
So, the total code would be:
COleVariant vTrue((short)TRUE),vFalse((short)FALSE),vOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
//Creates new doc
Documents documents = application.GetDocuments();
_Document document = documents.Add(vOpt,vOpt,&varEmpty,&varEmpty);
//First line
Window oWin = application.GetActiveWindow();
Pane oPane = oWin.GetActivePane();
View oView = oPane.GetView();
oView.SetSeekView(wdSeekCurrentPageHeader);
//Second line
Selection oSel = application.GetSelection();
Shapes oShapes = oSel.GetInlineShapes();
oShapes.AddPicture("c:\\Inspec\\LogoInspec.jpg",vFalse,vTrue,vOpt,vOpt,vOpt,vOpt,vOpt);
PageSetup pageSetup;
pageSetup.SetDifferentFirstPageHeaderFooter(TRUE);
Am I on the right track ?? Because this compiles ok, but gives me an error at runtime that says "Error...member not found"

I have 1 week to complete getting this straightened out...I would appreciate yoour help.Smile | :) I may certainly have other questions if you can help me ok on this one.
GeneralRe: Word Automation with MFC Pin
Peter Molnar24-Nov-03 2:05
Peter Molnar24-Nov-03 2:05 
GeneralRe: Word Automation with MFC Pin
Member 54540424-Nov-03 14:12
Member 54540424-Nov-03 14:12 
GeneralRe: Word Automation with MFC Pin
Peter Molnar24-Nov-03 14:25
Peter Molnar24-Nov-03 14:25 
GeneralI need help;( Pin
EEYOREBABE22-Nov-03 11:04
EEYOREBABE22-Nov-03 11:04 
GeneralRe: I need help;( Pin
Peter Molnar22-Nov-03 12:46
Peter Molnar22-Nov-03 12:46 
GeneralFormatRange with Html Edit Control Pin
Atlence22-Nov-03 9:15
Atlence22-Nov-03 9:15 
GeneralRe: FormatRange with Html Edit Control Pin
Peter Molnar22-Nov-03 12:50
Peter Molnar22-Nov-03 12:50 
GeneralRe: FormatRange with Html Edit Control Pin
Atlence22-Nov-03 16:11
Atlence22-Nov-03 16:11 
GeneralRe: FormatRange with Html Edit Control Pin
Peter Molnar23-Nov-03 9:48
Peter Molnar23-Nov-03 9:48 
Generalgetting address of Internet Shortcut Pin
K. Shaffer22-Nov-03 9:04
K. Shaffer22-Nov-03 9:04 
GeneralRe: getting address of Internet Shortcut Pin
K. Shaffer22-Nov-03 9:13
K. Shaffer22-Nov-03 9:13 
GeneralRe: getting address of Internet Shortcut Pin
Michael Dunn22-Nov-03 16:12
sitebuilderMichael Dunn22-Nov-03 16:12 
Generalail.comSocket not blocking Pin
Shenthil22-Nov-03 8:59
Shenthil22-Nov-03 8:59 
GeneralRe: ail.comSocket not blocking Pin
Peter Molnar22-Nov-03 14:20
Peter Molnar22-Nov-03 14:20 
GeneralRe: ail.comSocket not blocking Pin
Gabriel.P.G22-Nov-03 14:53
Gabriel.P.G22-Nov-03 14:53 
GeneralSocket not blocking Pin
Shenthil23-Nov-03 17:42
Shenthil23-Nov-03 17:42 
GeneralRe: Socket not blocking Pin
Gabriel.P.G24-Nov-03 14:00
Gabriel.P.G24-Nov-03 14:00 

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.