Opening the file in read only mode

hi all,
i am using
i want to open any type of files in read only mode using host command.so first i am setting the attribute to read only and then opening the file. But still the opened file is editable. i have written like below
Host( 'cmd /c  attrib +r "\test_folder\testing\PURCHASE_ORDER\'||:PO_FILE_NAME||'"',NO_SCREEN);
Host( 'cmd /c "\test_folder\testing\PURCHASE_ORDER\'||:PO_FILE_NAME||'"',NO_SCREEN);is this is the way to open the file in readonly mode?
Along with the above the files which i opened with the help of above said code those files i am not able to delete also.(i have to delete the selected file)
i thing when i am setting the attribute something is going for a mess!
Please help.
Thanks..
Edited by: GD on Jun 23, 2011 2:25 AM

hi,
Read only means you cannot mofiy the file. This also includes that you cannot delete a readonly-file yes,
what i am doing is i have three button in my layout 'save','view' and 'delete'.
1.so when user press 'save' button after selecting the file then the file gets saved into the specified.
2. when user press 'view' button the file has to open in read only mode.
for this i have written above mentioned code(but still i am able to edit the file)
3.when user press 'delete' button the file has to be deleted from the specified location.
so my problem is after setting file to read only mode, i am able to edit but i am not able to delete it.
What i am using to set the file to read only mode is right?
Please help.
Thanks..

Similar Messages

  • Issue regarding open word file and read only mode using c# & MS-word interop

    i am programmatically open a word file for search and highlight keyword. my routine is working fine. the problem is when i am opening the file programmatically then a dialog come and ask me to open file in read only mode. the dialog look like below one
    actually i do not want to open the file in read only mode because people can open and like to change and save. so guide me what i can do to not to open the file in read only mode.
    here is my full code. just have a look and tell me what is wrong in my code or tell me any trick as a result i can open the file not in read only mode. here is my code.
    private void button1_Click(object sender, EventArgs e)
                object fileName = "";
                string filePath = "";
                string strSaveasPath = "";
                DialogResult result = openFileDialog1.ShowDialog();
                if (result == DialogResult.OK)
                    fileName = openFileDialog1.FileName;
                    //strSaveasPath = Path.GetDirectoryName(path.ToString());
                //fileName = "Z:\\C0000000003.doc";
                List<string> _list = new List<string>();
                _list.Add("tridip");
                _list.Add("arijit");
                //object fileName = "D:\\CVArchievePath\\C0000000001.doc";
                object textToFind = "test";
                object readOnly = false;
                Word.Application word = new Word.Application();
                Word.Document doc = new Word.Document();
                object missing = Type.Missing;
                try
                    doc = word.Documents.Open(ref fileName, ref missing, ref readOnly,
                                              ref missing,
    ref missing, ref missing,
                                              ref missing,
    ref missing, ref missing,
                                              ref missing,
    ref missing, ref missing,
                                              ref missing,
    ref missing, ref missing,
                                              ref missing);
                    doc.Activate();
                    object matchPhrase = false;
                    object matchCase = false;
                    object matchPrefix = false;
                    object matchSuffix = false;
                    object matchWholeWord = false;
                    object matchWildcards = false;
                    object matchSoundsLike = false;
                    object matchAllWordForms = false;
                    object matchByte = false;
                    object ignoreSpace = false;
                    object ignorePunct = false;
                    object highlightedColor = Word.WdColor.wdColorGreen;
                    object textColor = Word.WdColor.wdColorLightOrange;
                    object missingp = false;
                    Word.Range range = doc.Range();
                    foreach (string line in _list)
                        textToFind = line;
                        bool highlighted = range.Find.HitHighlight(ref textToFind,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing,
    ref missing);
                    System.Diagnostics.Process.Start(fileName.ToString());
                catch (Exception ex)
                    Console.WriteLine("Error : " + ex.Message);
                    //Console.ReadKey(true);
                finally
                    //doc.Close(missing, missing, missing);
                    if(doc!=null)
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(doc);
                    if (word != null)
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(word);
                    word = null;
                    doc = null;
                    GC.Collect();
                    GC.WaitForPendingFinalizers();

    I know it's a very old issue and I reached to this page looking for a solution. Finally, I have found a fix to this problem.
    The problem is that we create an instance of Word and do not close it correctly. This makes program believe that the file is already open and hence you're getting the respective message of file being locked by you.
    Set the visibility of your application to true and then when you close it both file and instance should close and you will not get the problem again.

  • I am not able to use Firefox with Sharepoint - I can only open a file in read-only mode and cannot checkout the document and edit.

    I would like to use Firefox with Sharepoint.
    However, I am only able to open a file in "read only" mode whch means I cannot edit the document and save it. I am also not able to "check-out" a document in Sharepoint and edit it at the same time.

    This may not work for everyone, but I solved this problem by clicking on the file name in sharepoint, not the document icon to the left of the name. This then brought up the various options, including checking out, editing, version history etc. It seems obvious but I have only just realised this!

  • Open pdf files in read-only mode

    Hi all,
    I want to open a file and I want to have option rewrite the file while it's open in the Reader.
    Is there any way how to open the file in the read-only mode and even from cmd in Windows?
    Thanks in advance.

    You can set security in the file to dissallow changesby going to File>Properties>Security in Acrobat. But you can't change anything with Reader.

  • Opening a container in read-only mode (DB_RDONLY, setReadOnly())

    I have one process access a container in normal mode and another accessing it in read-only mode (XmlManager::openContainer with DB_RDONLY or XmlContainerConfig. setReadOnly(true) ), both with transactions. Is this:
    (1) wrong (potentially dangerous);
    (2) pointless (no benefits for the read-only process);
    (3) reasonable (potential benefits for the read-only process)?
    Whatever the answer, why is it so?
    Michael Ludwig

    hi,
    Read only means you cannot mofiy the file. This also includes that you cannot delete a readonly-file yes,
    what i am doing is i have three button in my layout 'save','view' and 'delete'.
    1.so when user press 'save' button after selecting the file then the file gets saved into the specified.
    2. when user press 'view' button the file has to open in read only mode.
    for this i have written above mentioned code(but still i am able to edit the file)
    3.when user press 'delete' button the file has to be deleted from the specified location.
    so my problem is after setting file to read only mode, i am able to edit but i am not able to delete it.
    What i am using to set the file to read only mode is right?
    Please help.
    Thanks..

  • Open EBS 115102 in read only mode

    Hi,
    I have upgraded our EBS 11510 to 1213 , on oracle 11202 DB.
    I have cloned a copy of the database and app. before the upgrade.
    I would like to give the end users an ability to open the old application and the db in read only mode.
    It is possible the open the application in read only mode ?
    If nnot what is my option the give an old-enchanged application to the end users , so they can compare diffs between old and new app ?
    Thanks
    Yoav

    Yoav wrote:
    Hi,
    I have upgraded our EBS 11510 to 1213 , on oracle 11202 DB.
    I have cloned a copy of the database and app. before the upgrade.
    I would like to give the end users an ability to open the old application and the db in read only mode.
    It is possible the open the application in read only mode ?
    If nnot what is my option the give an old-enchanged application to the end users , so they can compare diffs between old and new app ?
    Thanks
    YoavPlease see (Using Active Data Guard Reporting with Oracle E-Business Suite Release 12.1 and Oracle Database 11g [ID 1070491.1]).
    Thanks,
    Hussein

  • Office 2013 opens file in read only mode

    I have a client on Windows 8.1 Pro using Office 2013. When he access an office file from a network drive it opens in read only. When he saves the file to his desktop using save as it lets him open the file again in compatibility mode but he is unable to
    then overwrite the file on the network folder. It keeps giving him a permission error. I have deleted his profile, changed settings in office trust center settings and checked folder permisisons. I am out of ideas. Can anyone help me out here.
    Thanks

    Hi,
    Thanks for the reply.
    From the user, "Every file that I open, opens in read-only mode.  It appears that the security is set correctly and I have not changed anything, but, it does not allow it.  I have tried rebooting - not solved.  I tried disconnecting the shared drive and reconnecting - not solved.  However, when I do disconnect the mapped drive, I get a warning saying I have files open.  The problem occurs whether I access the files from the mapped drive or directly by drilling down through the folder structure." 
    When I try to move files over to the drive it says I do not have required permissions to overwrite or move a file. On a different computer he has full access but not on this one. Also the settings in trust center settings for file blocking and trusted locations
    also privacy.

  • Open a document in read only mode

    HI All,
    I created a panel in which we have
    edit box which shows the document path
    Browse button to allow a user to select an indesign document
    "Open read only" button.
    My requirement is that after selecting an Indesign document if user click to "OPen read only" button then it will opened selected document in read only mode.
    I will be highly thankfull to all community memeber if anyone can give me some hint to achieve this.
    Regards,
    Alam

    Alam,
    If you change the attributes of the file before opening it to read only the file will be opened as read only by Indesign. And then you could place a responder that could clear this read only flag when the file is being closed so that the permissions are restored to the original state.
    Manan Joshi
      - Efficient InDesign Solutions -
    MetaDesign Solutions
    http://metadesignsolutions.com/services/indesign-development.php

  • Open MS word file in read only mode

    Hi All,
    Is there any function module or method to open an MS word file (which is not read only ) in read only mode.
    User should only be able to see the document ,he should not be able to make any changes.
    Regards,
    Mukul Sharma.

    Hi,
    Where is the document stored? In a content server? In BDS? In a directory?
    Regards,
    bert

  • How can I protect a PDF file to where when I am editing the file and another user opens the file, it is only a read-only file?

    I work for an auditing firm and we have recently gone paperless with our audit documentation. We have our files saved on a server and multiple people can access the same file at one time. We noticed that Acrobat does not give an message notifying a user that someone else is in that file, nor does Acrobat make that PDF file a read only file when someone else is in it editing the document. Is there a way to notify someone that another user is in the same PDF file? Or is there a way to make a PDF read only when someone else is working with the document?

    Hi ashleyr1936858
    You can restrict editing of a pdf by setting the password, such that anyone who wants to edit the pdf would need to input that password. This would make the pdf a read-only file.
    Here's a Link for more information : Acrobat Help | Securing PDFs with passwords
    Regards,
    Rahul

  • Excel 2013 Cannot Save because the file is read-only.

    To  answer both. He can edit and save to these locations. Then randomly it comes up and says it is in read-only mode. He saves the document as something else. Deletes the original document and then renames the newly saved document back to the original name. Auto-save is on and working and he is using versioning but I believe those are on for everybody. Like I said I did a excel doc as him and didnt have any issues. So I am not sure what it takes to reproduce it. I actually made sure he wasnt also connected to wireless and he is not he is only hard wired.

    User keeps getting this same error on random excel files that he has opened for editing. They do not say read-only mode. They trust settings are correct. I created a spreadsheet modified it saved it and opened it every way I could think of and cannot reproduce the problem but can show me on the spreadsheets. It happens on his and others spreadsheets. Doesnt seem to be a rhyme or reason for it.
    Windows 7, 64 bit.
    This topic first appeared in the Spiceworks Community

  • XL Reports - EXCEL msg -You can only open the document as Read Only

    READ ONLY notification from MS EXCEL when two people try to run the same XLR report at the same time.  Here is what is going on:
    u2022     Person A runs an XLR report (SAP client running on a Local Machine)
    u2022     Person B runs the same XLR report and now gets a MS message to the fact that u201CYou can only open the document as Read Onlyu201D
    Can two people run and save the same report at the same time? If so, what do we need to do to allow this?

    Can two people run and save the same report at the same time ?
    The answer is NO.  It is because Excel locked the file.  Only one active user can do write operation on the file.  All other users may open the file read only.
    Thanks,
    Gordon

  • Which table shows the tablespace in read-only mode or read-write mode.

    HI All,
    Can someonoe help me out to find which table shows whether the a tablespace is in Read-only mode or Read-write.
    Thanks,
    naveen

    Try this:
    select tbl.table_name, tb.tablespace_name, TB.STATUS from dba_tablespaces tb, dba_tables tbl
    where TB.TABLESPACE_NAME = tbl.TABLESPACE_NAME and TB.TABLESPACE_NAME = 'YOUR_TABLESPACE_NAME' and tbl.table_name = 'TABLE_NAME'

  • When trying to save a file under Excel 2008, ver 12.3.3, with extension .xlsx or .xlx, I am told it can't be saved because it is "read only." How do I change the file from read only?

    When I try to save a file using Excel 2008, ver 12.3.3, with extension either .xlsx or .xls, I get a message saying it cannot be saved because it is "read only." How do I change it from read only? (And how did it ever get to be read only?)

    Save the file as a new name. Close and Open the new file.
    Most likely when a file transfer happens, Office makes the file 'Read Only'.
    If you have two opened files with the same name, the last opened file will be 'Read Only'.

  • Can I make 3D measurements in a 3D pdf, then have them automatically show upon opening the file - using Reader?

    I am trying to use Reader to set up how a 3D pdf initially opens - for example, showing measurements.
    Is this possible using only Reader?

    You can create the measurements in Reader but you cannot change the file's initial view settings - that's an Acrobat job.

Maybe you are looking for

  • How can I use my Zen Xtra like a flash memory

    Hello, I want to know how can I use my MP3 player like a flash memory. I have one and if I conect it with other computers I can't transfer documents and with a flash memory I conect it in all the computers with Windows XP and all of they detect the f

  • Error while calling stored procedure from Java

    Hi Guys, How are you everybody? I hope everything is goin fine on your side. I have one issue in PL/SQL while calling below stored procedures from Java. Problem Description: We have a stored procedure PROCEDURE BULK_INSERTS ( V_SESSION_ID_TAB IN T_SE

  • How to change the general Ledger of a purchase order in mass

    Hi, In our company, we change the General Ledgers, then, and we have plenty of purchases orders take the old general ledger, we want to change this general ledger by the new in each purchase order in mass. I found in BAPI, customizing, in user exit,

  • Spotlight in Time Machine

    I have noticed strange behavior of spotlight when searching in time machine backup. I open a folder, search for a file inside it (it is found) and then go to time machine. When folder is open in current state, the file stays found, but if I begin mov

  • Vendor problem in Garnishments

    Hi, In my company HR is being implemented now. We were using SAP Fi for more than a year (but in a different client). Now when we are implementing HR, we are not doing 3rd party remittance, and so we did not maintain any FI vendors in our present cli