Click here to Skip to main content
15,885,914 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading a specific word/phrase from a line Pin
xibeifeijian23-Apr-07 18:25
xibeifeijian23-Apr-07 18:25 
GeneralRe: Reading a specific word/phrase from a line Pin
Patrick Etc.23-Apr-07 18:34
Patrick Etc.23-Apr-07 18:34 
GeneralRe: Reading a specific word/phrase from a line Pin
zoroyster23-Apr-07 19:35
zoroyster23-Apr-07 19:35 
GeneralRe: Reading a specific word/phrase from a line Pin
xibeifeijian23-Apr-07 19:44
xibeifeijian23-Apr-07 19:44 
GeneralRe: Reading a specific word/phrase from a line Pin
Patrick Etc.24-Apr-07 6:00
Patrick Etc.24-Apr-07 6:00 
QuestionHow to impose Expire Date on MS Office files? [modified] Pin
sachinkalse23-Apr-07 17:21
sachinkalse23-Apr-07 17:21 
AnswerRe: How to impose Expire Date on MS Office files? Pin
Russell Jones24-Apr-07 0:04
Russell Jones24-Apr-07 0:04 
GeneralRe: How to impose Expire Date on MS Office files? [modified] Pin
sachinkalse13-Jun-07 16:36
sachinkalse13-Jun-07 16:36 
Maco can be disabled while opening the document, thus will not be useful.

We were trying to add permissions to the file ojbetcs directoy using following code but that is giving very generalized exception
"Value does not fall within the expected range"

Please have a look at the code below

------------------------------------------
<br />
using System; <br />
using System.Collections.Generic; <br />
using System.Text; <br />
using Microsoft.Office.Core; <br />
using ExcelInterop = Microsoft.Office.Interop.Excel; <br />
using Microsoft.Office.Interop.Word; <br />
 <br />
<br />
class Program <br />
{<br />
  private void ImposeExpiryDate()  <br />
{<br />
<br />
//For Excel <br />
ExcelInterop.ApplicationClass excel = new Microsoft.Office.Interop.Excel.ApplicationClass (); <br />
<br />
ExcelInterop.WorkbookClass workBook = (ExcelInterop.WorkbookClass)excel.Workbooks.Open( "c:\\test.xls", 0, true, 5, "" , "", true, ExcelInterop. XlPlatform .xlWindows, "\t", false, false , 0, true, 1, 0); <br />
ExcelInterop.Sheets sheets = workBook.Worksheets; <br />
<br />
DateTime dtExpirationDate = DateTime.Today.AddDays(2); <br />
try <br />
{<br />
  workBook.Permission.Add(@"sachin@abc.com" ,Microsoft.Office.Core.MsoPermission.msoPermissionFullControl, dtExpirationDate); <br />
}<br />
<br />
catch (Exception EX) <br />
{<br />
// "Value does not fall within the expected range" ???<br />
}<br />
<br />
<br />
//For Word <br />
// Microsoft.Office.Interop.Word.ApplicationClass WordApp = <br />
// new Microsoft.Office.Interop.Word. ApplicationClass (); <br />
// Microsoft.Office.Interop.Word.Document aDoc = <br />
//  WordApp.Documents.Open(ref fileName, ref missing, <br />
//  ref readOnly, ref missing, ref missing, ref missing, <br />
//  ref missing, ref missing, ref missing, ref missing, <br />
//  ref missing, ref isVisible); <br />
<br />
// aDoc.Permission.Add<br />
// ("sachin@abc.com" ,<br />
//  Microsoft.Office.Core.MsoPermission.msoPermissionFullControl, <br />
//  dtExpirationDate); <br />
}<br />
<br />
}<br />






Regards
Sachin
QuestionVery basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 17:05
wertyou23-Apr-07 17:05 
AnswerRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 17:27
Patrick Etc.23-Apr-07 17:27 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 17:37
wertyou23-Apr-07 17:37 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 17:45
Patrick Etc.23-Apr-07 17:45 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 18:04
wertyou23-Apr-07 18:04 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 18:27
Patrick Etc.23-Apr-07 18:27 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 18:42
wertyou23-Apr-07 18:42 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 18:45
Patrick Etc.23-Apr-07 18:45 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou24-Apr-07 14:53
wertyou24-Apr-07 14:53 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.24-Apr-07 15:09
Patrick Etc.24-Apr-07 15:09 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou24-Apr-07 15:30
wertyou24-Apr-07 15:30 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.24-Apr-07 15:49
Patrick Etc.24-Apr-07 15:49 
QuestionHow to enable internet explorer's "Disable script debugging option" thru code? Pin
engsrini23-Apr-07 16:25
engsrini23-Apr-07 16:25 
AnswerRe: How to enable internet explorer's "Disable script debugging option" thru code? Pin
Christian Graus23-Apr-07 16:41
protectorChristian Graus23-Apr-07 16:41 
GeneralRe: How to enable internet explorer's "Disable script debugging option" thru code? Pin
engsrini23-Apr-07 17:06
engsrini23-Apr-07 17:06 
Questionneed your help about datagridview Pin
phantanagu23-Apr-07 16:05
phantanagu23-Apr-07 16:05 
QuestionAppend WMV Files Pin
Muhammad Chitrali23-Apr-07 11:48
Muhammad Chitrali23-Apr-07 11:48 

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.