Open word document on clicking menu
-
Hi, I have created a User Interface which has a Help Menu in that i have USER Manual as submenu, when i click on User Manual sub menu it has to open an existing word document which contains details of how to use the User Interface. UI has been developed using MS VC++ .Please help me out. Thanks in advance
-
Hi, I have created a User Interface which has a Help Menu in that i have USER Manual as submenu, when i click on User Manual sub menu it has to open an existing word document which contains details of how to use the User Interface. UI has been developed using MS VC++ .Please help me out. Thanks in advance
-
ShellExecute(NULL, "open", "pathToYourDocFile", NULL, NULL, SW_SHOWNORMAL); See info on parameters here: MSDN: ShellExecute[^]
Thanks I used the code sent by you but it not opening the document. Below is the code void CNUITApp::OnHelpUsermanual() { ShellExecute(NULL, "open", "C:\\Doc1", NULL, NULL, SW_SHOWNORMAL); // TODO: Add your command handler code here AfxMessageBox(_T("Feature not available gg"),MB_OK|MB_ICONINFORMATION); }
-
Thanks I used the code sent by you but it not opening the document. Below is the code void CNUITApp::OnHelpUsermanual() { ShellExecute(NULL, "open", "C:\\Doc1", NULL, NULL, SW_SHOWNORMAL); // TODO: Add your command handler code here AfxMessageBox(_T("Feature not available gg"),MB_OK|MB_ICONINFORMATION); }
-
Is your file really called "Doc1" ? I suggest you use the following line: Pre Office 2007
ShellExecute(NULL, "open", "C:\\Doc1.doc", NULL, NULL, SW_SHOWNORMAL);
or Office 2007
ShellExecute(NULL, "open", "C:\\Doc1.docx", NULL, NULL, SW_SHOWNORMAL);
-
office 2003 is loaded in the system. I will be giving only the exe to the customer, so we specify the path like this then we need to keep on changing the path where ever the document is copied. How to ovecome with this issue?
Just use a relative path. E.g AppFolder | |--FolderA |--FolderB \--Help if exe is located in AppFolder, and .DOC file is in Help folder:
ShellExecute(NULL, "open", "Help\\YourFile.doc", NULL, NULL, SW_SHOWNORMAL);
if exe is located in FolderA, and .DOC file is in AppFolder:
ShellExecute(NULL, "open", "..\\YourFile.doc", NULL, NULL, SW_SHOWNORMAL);
-
Just use a relative path. E.g AppFolder | |--FolderA |--FolderB \--Help if exe is located in AppFolder, and .DOC file is in Help folder:
ShellExecute(NULL, "open", "Help\\YourFile.doc", NULL, NULL, SW_SHOWNORMAL);
if exe is located in FolderA, and .DOC file is in AppFolder:
ShellExecute(NULL, "open", "..\\YourFile.doc", NULL, NULL, SW_SHOWNORMAL);