Hi all, |
Re: Trying to find out OLE Object Properties |
Re: Trying to find out OLE Object Properties I see you can turn an embedded OLE objects into a variable type oleAutoObj: OleAutoObj oleGetAutoObject(Object, Column col, int oleIndex) GetEmbeddedAutoObj You can then use the OleAutoObj in the oleMethod() command, and perhaps there are arguments or parameters that will give you info about that OLE object.
|
Re: Trying to find out OLE Object Properties llandale - Wed Feb 24 15:23:44 EST 2010
I have tried looking at the rich text (with ole) of the OLE (both displayed as icon and displayed as editable text). This is the information it provides me: {\rtf1\ansi\ansicpg1252\deff0\deflang3081{\fonttbl{\f0\fnil\fcharset Times New Roman;}} \viewkind\uc1\pard\f0\fs20{\object\objemb{\*\objclass Excel.Sheet.8}\objw1650\objh930{\*\objdata 0105126335412301538f58e13a..... etc .... 1f0059113a13000 }{\result{\pict\wmetafile8{picw2910\pich1640\picwgoal1650\pichgoal930 000100009000 ... etc ... 1300003300050000 }}}\par} I currently use the rich text to figure out what type of object is embedded (here an Excel spreadsheet, but it can be something else) but I don't know how to figure out whether it is displayed as an icon or an editable block :( I have also tried to use getEmbeddedOle but while I can successfully get the embedded ole (with the same rich text as above) I don't know the name of the attribute that will let me access the display information, and it isn't documented in the DXL Reference Manual. I've also tried the following code (where o is my object with the embedded ole) OleAutoObj theApp = oleGetAutoObject(o) if (!null theApp) print "Yay! Got the app!" but theApp is always null... Am I using oleGetAutoObject wrong? I have also tried: RichText rtf string s = richText o."Object Text" EmbeddedOleObject myole for rtf in s do { if (rtf.isOle) { myole = rtf.getEmbeddedOle print "Yay! Got the ole!" } } which prints the yay, but I then run into the "what do/can I do with this EmbeddedOleObject type"?. There is no documentation on it in the DXL Reference Manual (dated 13-Jun-2001). What are the attributes of an EmbeddedOleObject? Also, I can't get getEmbeddedAutoObj to work. Can you post an example code? |
Re: Trying to find out OLE Object Properties driven_mad - Thu Feb 25 02:15:50 EST 2010
There are the perms that refer to EmbeddedOle. Obviously they are valid in all DOORS versions (since 7.1). I guess the names speak for themselfs. You can get the width, height, export the picture, copy it to the OLE clipboard, i get the RTF and I guess thats it :-) Note the last perm which will allow you to create an oleAutoObj of your object and use the active content. // RTF functions RTFEmbeddedOLE_ getEmbeddedOle () V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 EmbeddedOleObject ::. (RichText, RTFEmbeddedOLE_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string exportPicture (EmbeddedOleObject, string fileName, int format) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 bool oleCopy (EmbeddedOleObject) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (EmbeddedOleObject&, Object, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string getOleWidthHeight (EmbeddedOleObject, int&, int&)V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 EmbeddedOleObject ::. (RichText, RTFEmbeddedOLE_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string oleRtf (EmbeddedOleObject) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 // Richtext functions string ::. (RichText, RTFText_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 int ::. (RichText, RTFInt_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 bool ::. (RichText, RTFString_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichText&, RichTextParagraph, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichText&, RichTextParagraph, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 bool ::. (RichTextParagraph, RTFString_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string ::. (RichTextParagraph, RTFText_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichText&, string, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 int ::. (RichText, RTFCharset_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 int ::. (RichTextParagraph, RTFInt_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichTextParagraph&, string, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 OleAutoObj oleGetAutoObject (Object, Column col, int oleIndex) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 |
Re: Trying to find out OLE Object Properties Mathias Mamsch - Thu Feb 25 02:51:50 EST 2010
There are the perms that refer to EmbeddedOle. Obviously they are valid in all DOORS versions (since 7.1). I guess the names speak for themselfs. You can get the width, height, export the picture, copy it to the OLE clipboard, i get the RTF and I guess thats it :-) Note the last perm which will allow you to create an oleAutoObj of your object and use the active content. // RTF functions RTFEmbeddedOLE_ getEmbeddedOle () V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 EmbeddedOleObject ::. (RichText, RTFEmbeddedOLE_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string exportPicture (EmbeddedOleObject, string fileName, int format) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 bool oleCopy (EmbeddedOleObject) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (EmbeddedOleObject&, Object, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string getOleWidthHeight (EmbeddedOleObject, int&, int&)V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 EmbeddedOleObject ::. (RichText, RTFEmbeddedOLE_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string oleRtf (EmbeddedOleObject) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 // Richtext functions string ::. (RichText, RTFText_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 int ::. (RichText, RTFInt_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 bool ::. (RichText, RTFString_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichText&, RichTextParagraph, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichText&, RichTextParagraph, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 bool ::. (RichTextParagraph, RTFString_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 string ::. (RichTextParagraph, RTFText_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichText&, string, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 int ::. (RichText, RTFCharset_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 int ::. (RichTextParagraph, RTFInt_) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (RichTextParagraph&, string, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 OleAutoObj oleGetAutoObject (Object, Column col, int oleIndex) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2
Suppose I have an OLE object that I extracted from a rich text chunk. void doOleOperation(string someRichTextWithOle) { RichTextParagraph rp; RichText rt; for rp in someRichTextWithOle do { for rt in rp do { if (rt.isOle) { EmbeddedOleObject ole; embeddedOle = rt.getEmbeddedOle; //-------------------------------------------------------------- // Have EmbeddedOleObject. Suppose EmbeddedOleObject is a // Word.document and I want to do a few OLE operations on it. // // Looks like in order to do OLE operations you need a OleAutoObj. // I see: // OleAutoObj oleGetAutoObject(Object) // OleAutoObj oleGetAutoObject(Object, Column col, int oleIndex) // OleAutoObj oleGetAutoObject(string) // // I don't see anything to transform an EmbeddedOleObject into // a OleAutoObj? // // Any ideas? //-------------------------------------------------------------- // Need help here: OleAutoObj myWordOleAutoObj = someFunction(embeddedOle); } } // for rt } // for rp } |
Re: Trying to find out OLE Object Properties SystemAdmin - Mon Apr 04 13:12:50 EDT 2011
Suppose I have an OLE object that I extracted from a rich text chunk. void doOleOperation(string someRichTextWithOle) { RichTextParagraph rp; RichText rt; for rp in someRichTextWithOle do { for rt in rp do { if (rt.isOle) { EmbeddedOleObject ole; embeddedOle = rt.getEmbeddedOle; //-------------------------------------------------------------- // Have EmbeddedOleObject. Suppose EmbeddedOleObject is a // Word.document and I want to do a few OLE operations on it. // // Looks like in order to do OLE operations you need a OleAutoObj. // I see: // OleAutoObj oleGetAutoObject(Object) // OleAutoObj oleGetAutoObject(Object, Column col, int oleIndex) // OleAutoObj oleGetAutoObject(string) // // I don't see anything to transform an EmbeddedOleObject into // a OleAutoObj? // // Any ideas? //-------------------------------------------------------------- // Need help here: OleAutoObj myWordOleAutoObj = someFunction(embeddedOle); } } // for rt } // for rp } OleAutoObj handle with oleGetAutoObject(Object), you must first activate your EmbeddedOleObject. OleAutoObj is an OLE-friendly running application whereas EmbeddedOleObject is just a pointer to some info. I think.
|
Re: Trying to find out OLE Object Properties SystemAdmin - Mon Apr 04 13:12:50 EDT 2011
Suppose I have an OLE object that I extracted from a rich text chunk. void doOleOperation(string someRichTextWithOle) { RichTextParagraph rp; RichText rt; for rp in someRichTextWithOle do { for rt in rp do { if (rt.isOle) { EmbeddedOleObject ole; embeddedOle = rt.getEmbeddedOle; //-------------------------------------------------------------- // Have EmbeddedOleObject. Suppose EmbeddedOleObject is a // Word.document and I want to do a few OLE operations on it. // // Looks like in order to do OLE operations you need a OleAutoObj. // I see: // OleAutoObj oleGetAutoObject(Object) // OleAutoObj oleGetAutoObject(Object, Column col, int oleIndex) // OleAutoObj oleGetAutoObject(string) // // I don't see anything to transform an EmbeddedOleObject into // a OleAutoObj? // // Any ideas? //-------------------------------------------------------------- // Need help here: OleAutoObj myWordOleAutoObj = someFunction(embeddedOle); } } // for rt } // for rp } Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Trying to find out OLE Object Properties Mathias Mamsch - Mon Apr 04 15:40:48 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Had some disallowed content... OleAutoArgs args () { return create OleAutoArgs } OleAutoArgs ::<-(OleAutoArgs x, int a) { put(x, a); return x } OleAutoObj word = oleCreateAutoObject "Word.Application" olePut(word, "visible", false) if (null word) error "Please start word ..." RichTextParagraph rp; RichText rt; OleAutoObj docs, doc, sel, shps, shp print "Documents:" (oleGet(word, "Documents", docs)) "\n" print "Documents.add:" (oleMethod(docs, "Add")) "\n" print "ActiveDoc:" (oleGet(word, "ActiveDocument", doc)) "\n" print "Selection:" (oleGet(word, "Selection", sel)) "\n" for rp in richTextWithOle (current Object)."Object Text" do { for rt in rp do { if (rt.isOle) { EmbeddedOleObject embed = rt.getEmbeddedOle; print "Copy: " (oleCopy embed) "\n" print "Paste: " (oleMethod(sel, "Paste") ) "\n" } } // for rt } // for rp OleAutoObj theOLE print "SHAPES:" (oleGet(doc, "InlineShapes", shps)) "\n" print "SHAPE:" (oleMethod(shps, "Item", args <- 1, shp)) "\n" print "Activate:" (oleMethod(shp, "Activate")) "\n" print "Get the OLEFormat:" (oleGet(shp, "OLEFormat", theOLE) ) "\n" string sID print "Get the ProgID:" oleGet(theOLE, "ProgID", sID) print "Prog ID: " sID "\n" print "Finally Get the OLE Object: " (oleGet(theOLE, "Object", theOLE) ) "\n" print "Did we get something:" (!null theOLE) "\n" if (sID[0:4]== "Excel") { OleAutoObj oleApp, objWB oleGet(theOLE, "Application", oleApp) oleGet(oleApp, "ActiveWorkbook", objWB) string ss oleGet(objWB, "Name", ss) print ss }
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Trying to find out OLE Object Properties Mathias Mamsch - Mon Apr 04 15:42:20 EDT 2011
Had some disallowed content... OleAutoArgs args () { return create OleAutoArgs } OleAutoArgs ::<-(OleAutoArgs x, int a) { put(x, a); return x } OleAutoObj word = oleCreateAutoObject "Word.Application" olePut(word, "visible", false) if (null word) error "Please start word ..." RichTextParagraph rp; RichText rt; OleAutoObj docs, doc, sel, shps, shp print "Documents:" (oleGet(word, "Documents", docs)) "\n" print "Documents.add:" (oleMethod(docs, "Add")) "\n" print "ActiveDoc:" (oleGet(word, "ActiveDocument", doc)) "\n" print "Selection:" (oleGet(word, "Selection", sel)) "\n" for rp in richTextWithOle (current Object)."Object Text" do { for rt in rp do { if (rt.isOle) { EmbeddedOleObject embed = rt.getEmbeddedOle; print "Copy: " (oleCopy embed) "\n" print "Paste: " (oleMethod(sel, "Paste") ) "\n" } } // for rt } // for rp OleAutoObj theOLE print "SHAPES:" (oleGet(doc, "InlineShapes", shps)) "\n" print "SHAPE:" (oleMethod(shps, "Item", args <- 1, shp)) "\n" print "Activate:" (oleMethod(shp, "Activate")) "\n" print "Get the OLEFormat:" (oleGet(shp, "OLEFormat", theOLE) ) "\n" string sID print "Get the ProgID:" oleGet(theOLE, "ProgID", sID) print "Prog ID: " sID "\n" print "Finally Get the OLE Object: " (oleGet(theOLE, "Object", theOLE) ) "\n" print "Did we get something:" (!null theOLE) "\n" if (sID[0:4]== "Excel") { OleAutoObj oleApp, objWB oleGet(theOLE, "Application", oleApp) oleGet(oleApp, "ActiveWorkbook", objWB) string ss oleGet(objWB, "Name", ss) print ss }
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Between my posting earlier today and now I got something similar working. I saw those clipboard functions but turned pale. ack "Th\141nks" |
Re: Trying to find out OLE Object Properties SystemAdmin - Mon Apr 04 19:19:08 EDT 2011
Between my posting earlier today and now I got something similar working. I saw those clipboard functions but turned pale. ack "Th\141nks" Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |