Click here to Skip to main content
15,889,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: listbox!!!!!!!!!!!!!! Pin
Member 214683918-Aug-05 19:21
Member 214683918-Aug-05 19:21 
Generalthread suspended state Pin
johnny18217-Aug-05 21:44
johnny18217-Aug-05 21:44 
GeneralGetting File Path Pin
Veera Raghavendra17-Aug-05 20:24
Veera Raghavendra17-Aug-05 20:24 
GeneralRe: Getting File Path Pin
sunit517-Aug-05 20:53
sunit517-Aug-05 20:53 
GeneralRe: Getting File Path Pin
David Crow18-Aug-05 3:07
David Crow18-Aug-05 3:07 
Generalto view MSword document Pin
shaz jazz17-Aug-05 20:12
shaz jazz17-Aug-05 20:12 
GeneralRe: to view MSword document Pin
shaz jazz17-Aug-05 20:59
shaz jazz17-Aug-05 20:59 
GeneralRe: to view MSword document Pin
Barm17-Aug-05 21:24
Barm17-Aug-05 21:24 
I'm also working on dialog based application. When I click the buton create, it opens ms word and creates my document.

// this is the message map activated when the button is click
void CReport::OnButtonCreate()
{
_Application oWord;
Documents oDocs;
_Document oDoc;
Selection oSel;
Paragraphs oPar;
// these are declarations for ms word objects

// Create an instance of Word
if (!oWord.CreateDispatch("Word.Application"))
{
AfxMessageBox("Word failed to start!");
}
else
{ // Set the visible property
oWord.SetVisible(TRUE);
// Add a new document
oDocs = oWord.GetDocuments();
oDoc = oDocs.Add(vtOptional,vtOptional,vtOptional,vtOptional);

oSel = oWord.GetSelection(); // get the next possible input position
oPar = oSel.GetParagraphs();
oPar.SetAlignment(0); // set alignment, left, right, center, justify
oSel.TypeText("text to be shown");// this simulates a user typing text onto the document.
}
}

use the above only if u need to use ms words functions.

alternatively, if you do not need to make use of any ms word function,
use ShellExecute
GeneralRe: to view MSword document Pin
Jose Lamas Rios17-Aug-05 20:56
Jose Lamas Rios17-Aug-05 20:56 
GeneralRe: to view MSword document Pin
Rage17-Aug-05 21:17
professionalRage17-Aug-05 21:17 
GeneralRe: to view MSword document Pin
Aamir Butt18-Aug-05 2:04
Aamir Butt18-Aug-05 2:04 
General~~~~~~~noob framework question Pin
17-Aug-05 20:08
suss17-Aug-05 20:08 
GeneralRe: noob framework question Pin
toxcct17-Aug-05 20:51
toxcct17-Aug-05 20:51 
GeneralRe: noob framework question Pin
17-Aug-05 20:56
suss17-Aug-05 20:56 
GeneralRe: noob framework question Pin
Sam 200617-Aug-05 22:45
Sam 200617-Aug-05 22:45 
GeneralRe: noob framework question Pin
toxcct17-Aug-05 23:15
toxcct17-Aug-05 23:15 
GeneralRe: noob framework question Pin
Sam 200617-Aug-05 23:22
Sam 200617-Aug-05 23:22 
GeneralRe: noob framework question Pin
toxcct17-Aug-05 23:31
toxcct17-Aug-05 23:31 
GeneralRe: noob framework question Pin
Phil J Pearson17-Aug-05 23:37
Phil J Pearson17-Aug-05 23:37 
GeneralRe: noob framework question Pin
Sam 200617-Aug-05 23:52
Sam 200617-Aug-05 23:52 
GeneralRe: noob framework question Pin
normanS18-Aug-05 20:32
normanS18-Aug-05 20:32 
GeneralRe: noob framework question Pin
Sam 200619-Aug-05 3:05
Sam 200619-Aug-05 3:05 
GeneralRefresh Tab Controls Pin
Barm17-Aug-05 20:03
Barm17-Aug-05 20:03 
GeneralRe: Refresh Tab Controls Pin
mark novak18-Aug-05 0:33
mark novak18-Aug-05 0:33 
Generalvc and vc.net Pin
shaz jazz17-Aug-05 20:03
shaz jazz17-Aug-05 20:03 

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.