Hi, I am developing a windows application which needs word and visio application to be embedded on to a form. I am using DSOFramer Active-X control. My application reads data from the database (a BLOB Field - that contains the word or visio document as byte array) and creates a temporary file in the local directory and then opens that file using DSOFramer control. (http://support.microsoft.com/kb/311765) All the manipulations are stored on the same temporary file and update the file contents on to that database on save (as BLOB). After the temporary file is saved, I am opening the temporary file using IO.FileStream and reading the contents to byte() and updating the database with new binary data(BLOB Field) It works fine most of the time but some times while saving the word document it through an exception - "the target of an invocation" Inner Exception -System.Runtime.InteropServices.COMException (0x80030021): A lock violation has occurred. I hope this explains wat I am trying to do. Please could any one tell me where I am going wrong. Thanks in advance chirantan
I am also working on similar functionality. Please share your code How to open a Word document in DSOFramer? Thank you "Ram" wrote in message news:FCBA75C2-4FF4-4C3E-9F52-3CA847A9BA9C@microsoft.com... > Hi, > > I am developing a windows application which needs word and visio > application > to be embedded on to a form. I am using DSOFramer Active-X control. > > My application reads data from the database (a BLOB Field - that contains > the word or visio document as byte array) and creates a temporary file in > the > local directory and then opens that file using DSOFramer control. > (http://support.microsoft.com/kb/311765) > > > All the manipulations are stored on the same temporary file and update the > file contents on to that database on save (as BLOB). > > After the temporary file is saved, I am opening the temporary file using > IO.FileStream and reading the contents to byte() and updating the database > with new binary data(BLOB Field) > > It works fine most of the time but some times while saving the word > document > it through an exception - "the target of an invocation" > > Inner Exception -System.Runtime.InteropServices.COMException (0x80030021): > A > lock violation has occurred. > > I hope this explains wat I am trying to do. > > Please could any one tell me where I am going wrong. > > Thanks in advance > > chirantan >
Hi Bhaskar, you can use the following method to open an existing file. first argument - file (with full path) second arg - determins weather you open in read mode third arg - type of file you are woking with in this case its word document the last two arg - are missing as its is for web based application AxFramerControl1.Open(strFileLocation, False, "Word.Document", Type.Missing, Type.Missing) I hope this helps "Bhaskar" wrote: > I am also working on similar functionality. Please share your code How to > open a Word document in DSOFramer? > > Thank you > > "Ram" wrote in message > news:FCBA75C2-4FF4-4C3E-9F52-3CA847A9BA9C@microsoft.com... > > Hi, > > > > I am developing a windows application which needs word and visio > > application > > to be embedded on to a form. I am using DSOFramer Active-X control. > > > > My application reads data from the database (a BLOB Field - that contains > > the word or visio document as byte array) and creates a temporary file in > > the > > local directory and then opens that file using DSOFramer control. > > (http://support.microsoft.com/kb/311765) > > > > > > All the manipulations are stored on the same temporary file and update the > > file contents on to that database on save (as BLOB). > > > > After the temporary file is saved, I am opening the temporary file using > > IO.FileStream and reading the contents to byte() and updating the database > > with new binary data(BLOB Field) > > > > It works fine most of the time but some times while saving the word > > document > > it through an exception - "the target of an invocation" > > > > Inner Exception -System.Runtime.InteropServices.COMException (0x80030021): > > A > > lock violation has occurred. > > > > I hope this explains wat I am trying to do. > > > > Please could any one tell me where I am going wrong. > > > > Thanks in advance > > > > chirantan > > > > >
Thanks Ram, I am working on ASP.net application . I tried your code its working on Windows foms(after making small changes). My requirment is 1)Loading Document from DB to DSOFramer 2)Editing that Document and save it into DB again 3) I want to add a context menu to the DSO or adding menu to the Word doc( My menu contains info about custom merge fields) 4) I will add those merge fields to teh Docuiment and generate teh Document from Address DB. I am curious about 1 & 2 later. Please help me . once again thanks for extending your help. Bhaskar "Ram" wrote in message news:E2316D8F-A8E4-4F7C-9685-1EF3F568A783@microsoft.com... > Hi Bhaskar, > > you can use the following method to open an existing file. > > first argument - file (with full path) > second arg - determins weather you open in read mode > third arg - type of file you are woking with in this case its word > document > the last two arg - are missing as its is for web based application > > AxFramerControl1.Open(strFileLocation, False, "Word.Document", > Type.Missing, > Type.Missing) > > > I hope this helps > > > > "Bhaskar" wrote: > >> I am also working on similar functionality. Please share your code How to >> open a Word document in DSOFramer? >> >> Thank you >> >> "Ram" wrote in message >> news:FCBA75C2-4FF4-4C3E-9F52-3CA847A9BA9C@microsoft.com... >> > Hi, >> > >> > I am developing a windows application which needs word and visio >> > application >> > to be embedded on to a form. I am using DSOFramer Active-X control. >> > >> > My application reads data from the database (a BLOB Field - that >> > contains >> > the word or visio document as byte array) and creates a temporary file >> > in >> > the >> > local directory and then opens that file using DSOFramer control. >> > (http://support.microsoft.com/kb/311765) >> > >> > >> > All the manipulations are stored on the same temporary file and update >> > the >> > file contents on to that database on save (as BLOB). >> > >> > After the temporary file is saved, I am opening the temporary file >> > using >> > IO.FileStream and reading the contents to byte() and updating the >> > database >> > with new binary data(BLOB Field) >> > >> > It works fine most of the time but some times while saving the word >> > document >> > it through an exception - "the target of an invocation" >> > >> > Inner Exception -System.Runtime.InteropServices.COMException >> > (0x80030021): >> > A >> > lock violation has occurred. >> > >> > I hope this explains wat I am trying to do. >> > >> > Please could any one tell me where I am going wrong. >> > >> > Thanks in advance >> > >> > chirantan >> > >> >> >>