![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Add text to an object Topic Summary: Created On: 1-Dec-2006 02:50 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
We've replaced the standard "Insert OLE..." dialog with a customized one--mostly to simplify the interface, but we'd also like to insert the file name as text, either before or after the newly inserted OLE object.
The problem is that if we insert the object and then just do
the new object gets erased. On closer inspection, all rich text and OLEs get taken out, because the statement just treats everything as plain text. So I'm wondering if there's a simple way to add a little bit of text onto a rich text string without manually fiddling with the RTF that's already there. (The first solution that came to mind was to strip out the last '}', add a formatted RT string, and then put the '}' back on....that seems a little klugy though.) Any thoughts? Thanks, Chris |
|
![]() |
|
![]() |
|
Wouldn't the function richTextWithOle help?
o.OTEXT = richTextWithOle(o.OTEXT) "\n" get_plainname(filename) "" ------------------------- Pekka.Makinen@softqa.fi SoftQA Oy -http://www.softqa.fi/ |
|
![]() |
|
![]() |
|
[1] "string Text = o.OTEXT" retrieves only raw text. To retrieve rich text with the OLEs use "richTextWithOle(o, OTEXT)".
[2] "o.OTEXT = Text" sets the attribute with raw text from variable Text. To set Rich text (including OLEs) use "o.OTEXT = richText(Text)". Thus, your statement becomes: "o.OTEXT = richText(richTextWithOle(o, OTEXT) "\n" get_plainname(fileName) "") - Louie PS. See als command "richTextNoOle" that gets Rich Text but excludes OLE info. The "richText(o, OTEXT)" command is legacy, but works like the "richTextWithOle" command. EDIT CORRECTION: Works like the 'richtTextNoOle'command. Edited: 7-Dec-2006 at 01:32 by Louie Landale |
|
![]() |
|
![]() |
|
I like this idea.
I had figured that just concatenating a newline onto a properly-formatted RTF string would mangle things and be ugly, so I hadn't tried it. But, I did after you guys posted and it turns out that DOORS doesn't really care. It seems to re-form the RTF after you set the object text. Thanks! Chris |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Add text to an object
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.