pendragon
Well-known member
Hi All
Hope you can help, I am trying to open word and pass the document to open as a string.
If the string is c:\bin\calllog.doc then it opens fine but if the path includes spaces then word says it cant find the document
ie c:\Documents and Setting\Administrator\My Documents\CallLog.doc
Can some one please tell me what it is I am forgetting to do
this is the code I am using
Thank you for your help
Hope you can help, I am trying to open word and pass the document to open as a string.
If the string is c:\bin\calllog.doc then it opens fine but if the path includes spaces then word says it cant find the document
ie c:\Documents and Setting\Administrator\My Documents\CallLog.doc
Can some one please tell me what it is I am forgetting to do

this is the code I am using
PHP:
Process MyProcess;
string ProgramToRun = "WINWORD.EXE";
string DocumentToOpen = dataaccess.rowActions[dataaccess.colACTAttachmentPath].ToString() + dataaccess.rowActions[dataaccess.colACTAttachment].ToString();
MessageBox.Show(DocumentToOpen);
MyProcess = Process.Start(ProgramToRun, DocumentToOpen);
MyProcess.WaitForInputIdle();
MyProcess.Close();
MyProcess.Dispose();
Thank you for your help