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: Word hyperlink to bookmark during export
Topic Summary:
Created On: 19-Jun-2007 22:03
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.
 19-Jun-2007 22:03
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

I'm trying to set up an export function to create an MS Word hyperlink to a bookmark.  I've figured out the bookmark thing from past forum discussions, but can't figure out the hyperlink thing.  Is this possible?  I'm trying to do it by modifying the rich text directly, e.g. to take the text "Hello this is me" and set the word "this" as a hyperlink to a bookmark titled "MyBookmark", I'm trying:

string ReturnString = " Hello  HYPERLINK \\l \"MyBookmark\" this is me "

(there are 4 control characters in there - the first is ^S, then ^A, then ^T, then ^U)

where ReturnString is ultimately exported by 
    setRichClip(b, styleName, fontTable, !styleHasBullet, !styleHasIndent)
    return oleMethod(objSelection, cMethodPaste)

I tried this since when I open a Word doc with a text editor, that's what the hyperlink looks like.  Crude I know.

However this doesn't work, and I can't find any info on how to otherwise do this.

Any help I can get?

Report this to a Moderator Report this to a Moderator
 21-Jun-2007 12:25
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

Last call - anyone?  I was hoping.
Report this to a Moderator Report this to a Moderator
 27-Jun-2007 09:33
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

Hi John,

not an easy solution to your problem, but you could use WEXP for your export to Word. It supports the creation of bookmarks in the exported document and the creation of hyperlinks to the bookmarks.

Regards,

Peter

Edited: 27-Jun-2007 at 09:35 by Peter Albert
Report this to a Moderator Report this to a Moderator
 4-Jul-2007 19:19
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Just use Word's hyperlink object. Without checking I think you need to add one of these objects to a range/ selection object then load the "address" and "TextToDisplay" properties using OLE automation - which shouldn't be to difficult for you as you are clearly playing with it already. The bookmark is just narrowing down the reference and information on this should be reachable from the help on the hyperlink object within word. If memory serves I think its just a colon followed by the bookmark name appended to the address property.

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 5-Jul-2007 16:02
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

Peter - I've seen mention of WEXP, but not sure exactly what it is.  I don't seen any reference to it in the DOORS help or the Telelogic website.  Can you provide any info?

Report this to a Moderator Report this to a Moderator
 5-Jul-2007 16:06
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

Richard -

OK you just went way over my head on that.  I'm not familiar with OLE automation, or with what a range/selection object is.  Can I get some help on what those are, or perhaps maybe just more explicit steps and/or dxl code?

Thanks.
Report this to a Moderator Report this to a Moderator
 5-Jul-2007 16:31
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Ok. I may have misread your question. The following is a link to a bookmark called fred in a document called DOORS 8 Test Matrix.doc. Clicking on it opens the document and takes you to the bookmark in it. Thats what you want to do isn't it?

<file:///J:\POOL\Doorsdev\rmgworkingarea\DOORS 82 Testing\DOORS 8 Test Matrix.doc#Fred>

P.S. Why doesn't the DOORS external links thing have a dialog where you can browse to a document and then to a bookmark within it. This has been possible for ages, My create Hyperlink does this and is one of my simplest but most popular tools.

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 5-Jul-2007 16:55
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

That's not really what I want.  I'd like to set it up such that both the bookmark *and* the hyperlink are in the output exported Word document.  I believe the method you describe will work to set up a link from within DOORS to a Word document, but this outgoing link isn't reflected in the exported document.  Thus someone who doesn't have DOORS (most users of the output requirements document) can't use it.

I only need to link to within the current document, thus don't actually need the whole path of an existing document - I just want to link to a bookmark within document that's currently being exported, and I want to set up this Word link via DXL, based on a DOORS object -> DOORS object link.  I've figured out how to set up the bookmarks, based on the DOORS absolute numbers, just need to set up the Word link.

Thanks.

Report this to a Moderator Report this to a Moderator
 5-Jul-2007 19:32
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Post process the export of the document with a macro something like in the attached code. Also note that an rtf export of a doors hyperlink often autocorrects it to a hyperlink Word understands the macro is probably neater though.

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 5-Jul-2007 20:10
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

Wow - I didn't think of doing post-processing in a Word macro - that's a good idea.  I won't have time to try it for a few days, but will soon and post how it works out...

Thanks.
Report this to a Moderator Report this to a Moderator
 9-Jul-2007 08:27
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

quote:

Originally posted by: John Stock
Peter - I've seen mention of WEXP, but not sure exactly what it is. I don't seen any reference to it in the DOORS help or the Telelogic website. Can you provide any info?</P>


John,

WEXP is an enhanced DOORS-to-Word Exporter, it basically consists of a set of DXL routines. DOORS and MS Word are linked through additional attributes on the DOORS side and bookmarks in a Word template file. The bookmarks control how exported objects should look like, and with the attributes you can select which style is to be used for each object. There are other attributes on where to put the content in the file, others for the creation of footnotes and even others for the creation of bookmarks in the exported file. And then there is a special syntax to be put in the Object Text for the creation of hyperlinks to those user-defined bookmarks. Once set-up, all runs smoothly in my experience, but you need significant time and effort to get there, because you need some time in order to learn about the subtle interaction between the DOORS module to be exported, WEXP itself, and the Word template.

WEXP itself should be available through your local Telelogic representative. As far as I know, it was once developed by Jeremy Dick, who was also working on the multitude of kitchen scripts. I think he left Telelogic, but they still give it away on request. The drawback is that there is little further improvement (although through the time I am reading this newsgroup I think I saw a slight increase in version number), and, more important, there is literally no support through Telelogic. Which is easy to understand given that there is a Telelogic product called DocExpress.

Regards,

Peter
Report this to a Moderator Report this to a Moderator
 5-Oct-2007 21:19
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

quote:

Originally posted by: Richard Good
Post process the export of the document with a macro something like in the attached code. Also note that an rtf export of a doors hyperlink often autocorrects it to a hyperlink Word understands the macro is probably neater though.


So I tried the post-process macro thing.  I think it's the way to go, but can't figure out how to make it do what I need.  The macro snipped you attached inserts a link to the current document - what I need though is to transform the text from plain text into a link to a bookmark within the same document.

For instance in my current document say I have a bookmark "ABCD".  I then set up the dxl to export something like:

"LinkTo: ABCD"

Then I want to replace that text with a link to the ABCD bookmark (denoted by the # prefix) and keeping the ABCD text.

Sorry I'm not so much a Word macro expert - there's probably a way to do this but if so I'm not sure how.

Thanks.

P.S. to Peter, regarding WEXP - I tried that a lot as well, with no luck.  I installed it and ran export with the recommended format "precursor text [ ABCD "#ABCD" ] post text", but it didn't do as advertised - no hyperlink was set up.  Perhaps WEXP requires me to tie in to WEXP export routines and/or replaces the existing routines that come with DOORS.  However we've customized those routines quite a bit and so I don't want to do that.  What I'd really like is to be able to see the dxl that WEXP uses for hyperlinking, but I see the source code isn't made available apparently. 

I tried all kinds of rich text manipulation as well, and came *really* close, by looking at the resultant Word files byte-wise, but Word uses some device control characters (DC1, DC3, DC4) for hyperlinking, and I couldn't get those to come out using rich text.

So the quest continues - any further help would be appreciated.  Does anyone have the dxl code that WEXP uses for hyperlinking?

Report this to a Moderator Report this to a Moderator
 8-Oct-2007 09:16
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

Hi John,

first, yes, WEXP is tied to the WEXP exporter, you can't use the WEXP Attributes with the standard Word Exporter. However, you said you want to / must stay with the latter, therefore I modified a Visual Basic script which I posted here recently. It was originally written to decrease the font size of text between two user-defined strings, but it was easy to modify it to create the Hyperlinks to bookmarks.

However, it requires a slightly different output preparation: You now export things to look like:

"LinkTo: ABCD"

This makes it easy to find the start of the bookmark, but not the end of the bookmark. I'd therefore suggest to export the following:

"Some text startLinkABCDendLink more text"

If you then run the attached Macro, it will loop through the text, create everything between "startLink" and "endLink" into a Hyperlink to the appropriate Bookmark and delete the "startLink"s and "endLink"s.

Cheers,

Peter
Report this to a Moderator Report this to a Moderator
 8-Oct-2007 15:51
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

Peter,

Thanks so much!  That works great, and is exactly what I needed.

John

Report this to a Moderator Report this to a Moderator
 8-Oct-2007 15:52
User is offline View Users Profile Print this message


John Stock

Posts: 11
Joined: 11-Jun-2007

(Thanks Richard for your help as well)

John
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.