Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Open Word OLE object in Word application
Topic Summary:
Created On: 31-May-2005 10:54
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 31-May-2005 10:54
User is offline View Users Profile Print this message


Karsten Krennrich

Posts: 2
Joined: 3-May-2005

Hi,

I am trying to open a Word OLE which is stored in the object text of an object in the Word application. Does anybody has a solution for that problem?
Thank you for help!

Regards
Karsten
Report this to a Moderator Report this to a Moderator
 31-May-2005 12:59
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

bool oleActivate(Object o)
string oleActivate(Object o, Column c, integer index)

opens the embedded OLE in its host application.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 1-Jun-2005 18:50
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

Tony,

Excellent answer to Karsten's question. I have a follow-up question that is stumping me.

I'm trying to open a Word OLE document which is stored in the object text of an object, make a change, and then save it back to DOORS.

The attached code opens the Word document and makes a change, but it doesn't seem to store the change back to DOORS.

I've tried different combinations of the last four commands:

oleMethod( objWordDocument, "Save" )
oleMethod( objWordApplication , "Close" )
oleCloseAutoObject( objWordDocument )
oleDeactivate( current Object )

and none seem to give the desired result.

-------------------------
Michael Sutherland
michael@galactic-solutions.com
http://galactic-solutions.com
Report this to a Moderator Report this to a Moderator
 3-Jun-2005 10:38
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Michael,
this one has got me stumped. I have tried everything I can think of and the changes never get saved back to DOORS. The commands look correct and they match what I get when I open and edit the OLE manually and record the keystrokes as a macro in word.

Anyone else got a clue?

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 4-Jun-2005 13:00
User is offline View Users Profile Print this message


Roy Bond

Posts: 39
Joined: 25-Mar-2003

Michael / Tony,

I use the following to open any OLE in its associated application, and haven't yet had any problems....



Object obj = current

if (oleIsObject obj){

if (oleOpen obj == false) {

ack "Problem trying to activate object\n"

}

} else {

ack "Does not contain an embedded object\n"

}



Regards,

Roy.

Roy Bond
MTU Aero Engines
Munich

roy-david.bond@muc.mtu.de
Report this to a Moderator Report this to a Moderator
 6-Jun-2005 09:35
User is offline View Users Profile Print this message


Judith Underwood

Posts: 35
Joined: 25-Sep-2002

Hmm, this is an interesting one. I couldn't reproduce the problem at first, but then I discovered that it makes a difference if the embedded document is displayed as an icon. Specifically, if the embedded document is displayed as an icon, the changes are not saved, but if it is not displayed as an icon, the changes are saved. The difference may really be that the document is opened externally and not in-place.

I think that in the case that Word is opened externally, Word is not informing DOORS that a change has taken place, so DOORS doesn't think that the attribute value needs to be changed. I've been trying to think of a workaround but haven't come up with anything nice just yet.

Judith
Report this to a Moderator Report this to a Moderator
 6-Jun-2005 14:25
User is offline View Users Profile Print this message


Dale Reed

Posts: 11
Joined: 13-Sep-2002

Michael,

I am still using 5.2 (long story) but it seems to work okay for me. I had to adjust the code a little. It may not make much of a difference on your end.
Report this to a Moderator Report this to a Moderator
 6-Jun-2005 17:17
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

Dale,

I tested you code, and it does work. I re-tested my code posted above, and now it works as well, where it didn't last week. Both times, the Word document was embedded as an Icon.

Tony tested my original code and it didn't work for him, so there seems to be some situations where the code works, and some situations where it does not, but it is not yet apparant what that situation is.

I am using DOORS 7.1 patch 012, build 71167.

-------------------------
Michael Sutherland
michael@galactic-solutions.com
http://galactic-solutions.com
Report this to a Moderator Report this to a Moderator
 7-Jun-2005 08:10
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

This is frustrating.
I tried Dale's code.
It does not work when OLE is displayed as icon, but works otherwise.
I am using DOORS 7.1 patch 11, Word 2002, Windows 2000 Professional.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 7-Jun-2005 15:34
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

Tony,

I am using DOORS 7.1 patch 012 build 71167, Word 2002 SP3, Windows XP Pro 2002 SP1.

I tried both version of the code again today, and they both worked, with the Word document embedded as an Icon.

Thanks for the help, but now is seems you are more frustrated with the problem than I am.

-------------------------
Michael Sutherland
michael@galactic-solutions.com
http://galactic-solutions.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.