Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using CxImageLib Pin
Kiran Pinjala7-Aug-06 2:53
Kiran Pinjala7-Aug-06 2:53 
GeneralRe: Using CxImageLib Pin
Viorel.7-Aug-06 3:00
Viorel.7-Aug-06 3:00 
GeneralRe: Using CxImageLib Pin
Kiran Pinjala7-Aug-06 2:47
Kiran Pinjala7-Aug-06 2:47 
GeneralRe: Using CxImageLib Pin
Viorel.7-Aug-06 3:12
Viorel.7-Aug-06 3:12 
QuestionHow to launch Microsoft Word Pin
Wim Engberts7-Aug-06 0:03
Wim Engberts7-Aug-06 0:03 
AnswerRe: How to launch Microsoft Word Pin
Rage7-Aug-06 0:24
professionalRage7-Aug-06 0:24 
AnswerRe: How to launch Microsoft Word Pin
Hamid_RT7-Aug-06 2:29
Hamid_RT7-Aug-06 2:29 
AnswerRe: How to launch Microsoft Word Pin
georgekjolly7-Aug-06 20:02
georgekjolly7-Aug-06 20:02 
Hi try this, may help u

http://support.microsoft.com/kb/178749/E-US/

then use this code in ur programme

BOOL CLastApp::InitInstance()
{

if(!AfxOleInit()) // Your addition starts here
{
AfxMessageBox("Could not initialize COM dll");
return FALSE;
}
else
{
//AfxMessageBox("Inint");
}

_Application app; // app is the Excel _Application object


if(!app.CreateDispatch("Word.Application"))
{
AfxMessageBox("Couldn't start Excel.");
}
else
{
app.SetVisible(TRUE);
}

COleVariant covTrue((short)TRUE),covFalse((short)FALSE),covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR),covFormat( short(7));
COleVariant m_Long((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

AfxEnableControlContainer();


Documents docs = app.GetDocuments();
unsigned long int i = 1;

CFileFind finder;
CString file_name;
CString path;

BOOL bWorking = finder.FindFile("d:/george/*.doc");

while(bWorking){

bWorking = finder.FindNextFile();
file_name = finder.GetFileName();

path = "D:\\george\\"+ file_name;

//AfxMessageBox(path);

_Document doc = docs.Open(
COleVariant(path),
covTrue, // Confirm Conversion.
covTrue, // ReadOnly.
covFalse, // AddToRecentFiles.
covOptional, // PasswordDocument.
covOptional, // PasswordTemplate.
covFalse, // Revert.
covOptional, // WritePasswordDocument.
covOptional, // WritePasswordTemplate.
covTrue,
covTrue,
covOptional,
covOptional,
covOptional,
covOptional);


/*VARIANT* FileName,
VARIANT* FileFormat,
VARIANT* LockComments,
VARIANT* Password,
VARIANT* AddToRecentFiles,
VARIANT* WritePassword,
VARIANT* ReadOnlyRecommended,
VARIANT* EmbedTrueTypeFonts,
VARIANT* SaveNativePictureFormat,
VARIANT* SaveFormsData,
VARIANT* SaveAsAOCELetter,
VARIANT* Encoding,
VARIANT* InsertLineBreaks,
VARIANT* AllowSubstitutions,
VARIANT* LineEnding,
VARIANT* AddBiDiMarks)*/


/*doc.SaveAs(COleVariant(path),
covFormat,covOptional,covOptional,
covOptional,covOptional,covFalse,covOptional,
covTrue,covFalse,covOptional, covOptional,covTrue,covOptional,covOptional,covOptional);*/

file_name.Format("%lu",i);
path = "D:\\work\\"+file_name+".txt";

//AfxMessageBox(path);

doc.SaveAs( COleVariant(path),
covFormat,
covOptional,
covOptional,
covOptional,
covOptional,
covFalse,
covOptional,
covTrue,covFalse,covOptional, covOptional,covTrue,covOptional,covOptional,covOptional);



doc.Close(m_Long,m_Long,m_Long);
i++;

//docs.Close(m_Long,m_Long,m_Long);
}

app.Quit(m_Long,m_Long,m_Long);

AfxMessageBox("Completed");




#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif


return FALSE;
}

QuestionA Question about void! Pin
Abhishek Shekhar6-Aug-06 23:48
Abhishek Shekhar6-Aug-06 23:48 
AnswerRe: A Question about void! Pin
Programm3r6-Aug-06 23:59
Programm3r6-Aug-06 23:59 
AnswerRe: A Question about void! Pin
Zac Howland7-Aug-06 5:27
Zac Howland7-Aug-06 5:27 
QuestionNothing on codeproject I NEED HELP ! Pin
Bravoone_20066-Aug-06 23:30
Bravoone_20066-Aug-06 23:30 
AnswerRe: Nothing on codeproject I NEED HELP ! Pin
Bravoone_20066-Aug-06 23:46
Bravoone_20066-Aug-06 23:46 
GeneralRe: Nothing on codeproject I NEED HELP ! Pin
kakan7-Aug-06 0:04
professionalkakan7-Aug-06 0:04 
GeneralRe: Nothing on codeproject I NEED HELP ! Pin
Bravoone_20067-Aug-06 0:09
Bravoone_20067-Aug-06 0:09 
GeneralRe: Nothing on codeproject I NEED HELP ! [modified] Pin
kakan7-Aug-06 0:17
professionalkakan7-Aug-06 0:17 
GeneralRe: Nothing on codeproject I NEED HELP ! Pin
David Crow7-Aug-06 3:12
David Crow7-Aug-06 3:12 
GeneralRe: Nothing on codeproject I NEED HELP ! Pin
kakan7-Aug-06 19:18
professionalkakan7-Aug-06 19:18 
GeneralRe: Nothing on codeproject I NEED HELP ! Pin
PlayByTheRules7-Aug-06 1:45
PlayByTheRules7-Aug-06 1:45 
GeneralRe: Nothing on codeproject I NEED HELP ! Pin
David Crow7-Aug-06 3:02
David Crow7-Aug-06 3:02 
AnswerRe: Nothing on codeproject I NEED HELP ! Pin
PlayByTheRules7-Aug-06 1:45
PlayByTheRules7-Aug-06 1:45 
QuestionRe: Nothing on codeproject I NEED HELP ! Pin
David Crow7-Aug-06 3:05
David Crow7-Aug-06 3:05 
Questionadding table in tooltip Pin
Manjunath S6-Aug-06 23:29
Manjunath S6-Aug-06 23:29 
AnswerRe: adding table in tooltip Pin
Rage7-Aug-06 1:18
professionalRage7-Aug-06 1:18 
AnswerRe: adding table in tooltip Pin
Hamid_RT7-Aug-06 2:41
Hamid_RT7-Aug-06 2:41 

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.