![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Include file to get OLE/COM easier Topic Summary: Some usefull stuff to work with VBA Created On: 26-Jul-2006 07:56 Status: Post and Reply |
Linear : Threading : Single : Branch |
|
![]() |
![]()
|
![]() Answer: Hi Simon, you are right, I've updated the file already, but did not posted here, sorry. Please try the attached one - it should work better ![]() Greetings Reik Schröder | |||||||||
![]() |
|||||||||
Hi @all,
as I've seen, there are often problems concerning VBA/OLE/COM and Doors. So I want to help you a little bit and share my very simple, but powerfull include file with you ![]() It will allow you to use a dot instead of complicate calls to oleGet or oleMethod. I hope you will enjoy it ... Greetings Reik Schroeder
------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Very cool! Thanks for posting Reik!
Shawn ------------------------- Shawn Stepper shawn.e.stepper@wellsfargo.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Are you serious?????
That is completely awesome Reik! It will make my life so much easier.....especially since my next big project requires a lot of OLE interaction with Word. I've been playing with it and it's great. Thank you! Chris |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
wow reik, what a great idea of overloading the dot-expression
that would have helped me great but now im almost finish with my word-project ![]() thanx for that nice file |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Superb, will file under "why didn't I think of this?"
------------------------- Andrew Tagg Thales Air Systems, Melbourne Australia. andrew.tagg@thalesatm.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Is there a any way to put a (or more) parameter to a call, like
OleAutoObj objOutlook = newOle(cObjOutlookApplication) objOutlook.sendMail(sendTo,subject,...) // <-- this, I mean or objOutlook.sendMail("my.name@company.com") or objOutlook.To("my.name@company.com") / i.e. objOutlook.Subject("SUBJECT") objOutlook.Body("BODY") objOutlook.Display instead of calling a procedure ("sendMail( objOutlook, sendTo, subject, ...)")? ------------------------- Dirk Plaschke |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi Dirk,
of course it possible to have such functions, but it is a little bit more complicated. You need to store the method name and the parameters into a special parameter block ![]() please attached example, how it could be done ... I did not used OLE automation for Outlook until now, so I do not know exactly how to send a mail, please refer to VBA manual or to Tony's posting in this forum Sending eMails with Outlook Greetings to Treptow ![]() Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi, Reik.
Thanks for your knowledge ;-) ... but DOORS rejects a call like objOutlook.subject("Sorry, no mail!") DOORS prefers a objOutlook.(subject("Sorry, no mail!")) (notice the '(' before 'subject...' The error message is: -E- DXL: <\oleOutlook.lib:287> incorrect arguments for (.) and -E- DXL: <\oleOutlook.lib:287> incorrectly concatenated tokens Did you know a fix for that? PS: It#s sort of weird, to comuunicate via Britain from Berlin to Berlin, isn't it? ------------------------- Dirk Plaschke |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi Dirk,
sorry, you might be right ... this idea of implementing oleMethod call was in my mind for a long time, but did not checked, if it really works ... Now I tried it for some MS Word functions and come to the same result. It seems to be a problem of interpretation of code from left to right. For now I've no suggestion, how to solve this problem - but I think it looks much better than the original checkRes(oleMethod .... stuff ![]() Greetings Reik P.S.: The Server of this site seems to be in Sweden, so the communication from Berlin to Berlin is done via Sweden ![]() ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi @all,
here is a new version the include file, which allows now to assign oleProperties in a "nice" syntax: obj."Property" = value; Another new idea is to allow the creation of oleMethods, but unfortunately it works not as supposed. (: You need to add some more parenthis to get it work. A call to example CreateItem method would like this : OleAutoObj msg = outlook.(createItem (0)); assuming that outlook helds an MS Outlook appliaction object. Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany Edited: 16-Aug-2006 at 12:31 by Reik Schroeder |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
This should definately be included as standard with DOORS. Always wondered why telelogic made such a meal of the OLE syntax?
------------------------- Andrew Tagg Thales Air Systems, Melbourne Australia. andrew.tagg@thalesatm.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Awesome Reik.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com Edited: 10-May-2007 at 17:41 by David Pechacek |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Thank you, I'm really supprised that you like this idea
![]() Now I have an addon. I have extracted all the constants form MS Office applications using the oleview.exe tool from Windows Server 2003 Resource Kit Tools You will find them attached including perl script to convert the IDL file into these constant files. Greetings Reik
------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany Edited: 14-May-2007 at 05:32 by Reik Schroeder |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi,
Is anyone else having problems downloading Reik's PERL script file? When I try to download it I get a "Page Not Found" error. Are you able to re-post Reik? ------------------------- Paul Miller Specification Practices Specialist, EuroCyber, Melbourne, Australia. Mobile: +61 (0)418 135 103 Web Site: http://www.eurocyber.biz E-mail: miller@eurocyber.biz">pmiller@eurocyber.biz |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi Paul,
it seems to be a real problem of the forum server to handle .pl files .... The only way to place the code here was to zip it ![]() So i've changed the original post to contain the perl script in a zip file ![]() Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi Reik
Thanks for making OLE usable! ![]() I can get property values, but not set them. For instance, the following code doesn't work: #include <utils/ole.inc> #include <../inc/OLE_COM/OLE_COM.inc> #include <../inc/OLE_COM/oleWordConstants.inc> OleAutoObj objWord = initializeOLEapplication(cObjWordApplication) OleAutoObj objFind = objWord."ActiveDocument"."Content"."Find" objFind."Forward" = true I get the checkRes() error message. I looked at your clever OLE_COM.inc to try to work out why, but don't understand the following: ... OleAutoObj ::= (olePropertyLHS p, _x val) { // implementation of olePut ... What is "_x"? (If I change this to "bool" the code works fine, but obviously for booleans only!) Any help appreciated... regards, Simon PS. I'm using DOORS 8.3. ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
This is coool. I was just starting to work with word and am sure this would make my job easier.
thanx for sharing it with us. |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
This is coool. I was just starting to work with word and am sure this would make my job easier.
thanx for sharing it with us. |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi Simon,
sory for my late answer, but I hevn't much time to look into forum the last weeks .. month ![]() You cannot cascade the syntax I've implemented. That means your code should look like this: //#include <utils/ole.inc> #include <../inc/OLE_COM/OLE_COM.inc> #include <../inc/OLE_COM/oleWordConstants.inc> OleAutoObj objWord = initializeOLEapplication(cObjWordApplication) OleAutoObj objAD = objWord."ActiveDocument"; OleAutoObj objContent = objAD."Content"; OleAutoObj objFind = objContent."Find" objFind."Forward" = true closeIfNonNull (objFind); closeIfNonNull (objContent); closeIfNonNull (objAD); closeIfNonNull (objWord); The close functions are really needed! There is a limit on number of open Ole handles and they will not be closed automatically. It can happen, if you have left an open OLE handle, that the target application can not be closed correctly. Hope that helps you, Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi Reik
Thanks very much for your reply. I should have explained my problem better though. ![]() The line that fails in my example is: and I find it still fails in your code above. I get the "OLE method failed" error from checkRes(). The error is coming from your implementation of olePut, but I'm not sure if I'm using it incorrectly or if it's a bug. Can you run your code above successfully? (I tried it from the DOORS Edit DXL window, with Word already open.) Also, please could you tell me what "_x" means in the following?: I can't find it in the documentation, so I assume it's one of those undocumented DXL features?? ![]() Many thanks in advance for any help you can offer... best regards, Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|||||||||
![]() |
|||||||||
Telelogic DOORS
» DXL Exchange
»
Include file to get OLE/COM easier
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.