Click here to Skip to main content
15,896,518 members
Home / Discussions / C#
   

C#

 
GeneralRe: Folder Permissions Pin
Heath Stewart9-Dec-03 2:56
protectorHeath Stewart9-Dec-03 2:56 
GeneralDesign Technique Pin
Ken Galer9-Dec-03 2:36
Ken Galer9-Dec-03 2:36 
GeneralRe: Design Technique Pin
Heath Stewart9-Dec-03 2:54
protectorHeath Stewart9-Dec-03 2:54 
GeneralRe: Design Technique Pin
hazzem elrefai9-Dec-03 22:47
hazzem elrefai9-Dec-03 22:47 
GeneralRe: Design Technique Pin
Ken Galer10-Dec-03 2:33
Ken Galer10-Dec-03 2:33 
GeneralWord object Pin
hazzem elrefai8-Dec-03 23:57
hazzem elrefai8-Dec-03 23:57 
GeneralRe: Word object Pin
Colin Angus Mackay9-Dec-03 0:19
Colin Angus Mackay9-Dec-03 0:19 
GeneralRe: Word object Pin
hazzem elrefai9-Dec-03 0:35
hazzem elrefai9-Dec-03 0:35 
i typed the full path but the code doesn't compile at all
this code is:
private void btn_create_Click(object sender, System.EventArgs e)
{
Microsoft.Office.Interop.Word.Application newApp = new Microsoft.Office.Interop.Word.Application();

l_status.Text+="object instantiated\n";

object Source="c:\\abc\\dat.doc";
object Target="c:\\abc\\Target.rtf";

object Unknown =Type.Missing;

// Source document open here
// Additional Parameters are not known so that are
// set as a missing type
newApp.Documents.Open(ref Source,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,ref Unknown);
l_status.Text+="file opened\n";

// Specifying the format in which you want the output file
object format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatRTF;

l_status.Text+="new format created";

//Changing the format of the document
newApp.ActiveDocument.SaveAs(ref Target,ref format,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown);

l_status.Text+="new file saved \n";

// for closing the application
newApp.Quit(ref Unknown,ref Unknown,ref Unknown);

l_status.Text+="object closed \n";
}


===============================================
the error message is :

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in code_container.exe

Additional information: The server threw an exception.
GeneralRe: Word object Pin
Colin Angus Mackay9-Dec-03 0:56
Colin Angus Mackay9-Dec-03 0:56 
GeneralRe: Word object Pin
hazzem elrefai9-Dec-03 1:17
hazzem elrefai9-Dec-03 1:17 
GeneralRe: Word object Pin
Colin Angus Mackay9-Dec-03 2:15
Colin Angus Mackay9-Dec-03 2:15 
GeneralRe: Word object Pin
hazzem elrefai9-Dec-03 2:35
hazzem elrefai9-Dec-03 2:35 
GeneralRe: Word object Pin
Heath Stewart9-Dec-03 2:51
protectorHeath Stewart9-Dec-03 2:51 
GeneralRe: Word object Pin
Colin Angus Mackay9-Dec-03 3:08
Colin Angus Mackay9-Dec-03 3:08 
GeneralRe: Word object Pin
hazzem elrefai9-Dec-03 3:20
hazzem elrefai9-Dec-03 3:20 
GeneralRe: Word object Pin
Colin Angus Mackay9-Dec-03 3:29
Colin Angus Mackay9-Dec-03 3:29 
GeneralRe: Word object Pin
hazzem elrefai9-Dec-03 3:35
hazzem elrefai9-Dec-03 3:35 
GeneralRe: Word object Pin
Colin Angus Mackay9-Dec-03 3:45
Colin Angus Mackay9-Dec-03 3:45 
GeneralRe: Word object Pin
hazzem elrefai9-Dec-03 4:29
hazzem elrefai9-Dec-03 4:29 
GeneralRe: Word object Pin
hazzem elrefai9-Dec-03 1:36
hazzem elrefai9-Dec-03 1:36 
GeneralProperties inspector style control Pin
AJ1238-Dec-03 23:02
AJ1238-Dec-03 23:02 
GeneralRe: Properties inspector style control Pin
Heath Stewart9-Dec-03 2:47
protectorHeath Stewart9-Dec-03 2:47 
GeneralPlay avi video in full screen Pin
kuya0008-Dec-03 20:56
kuya0008-Dec-03 20:56 
GeneralRe: Play avi video in full screen Pin
Heath Stewart9-Dec-03 2:45
protectorHeath Stewart9-Dec-03 2:45 
QuestionHow keep areference of string Pin
Eric Lacroix8-Dec-03 17:53
Eric Lacroix8-Dec-03 17:53 

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.