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: Importing from Word: Ref fields seems to cause failure
Topic Summary: Show Field Codes seems to affect success of Word import
Created On: 15-Sep-2005 15:57
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.
Answer This question was answered by Walter Jackson, on Friday, September 16, 2005 2:34 PM

Answer:
Thank you Hubertus. This macro (after I removed the comment marks from the "With Selection.Find" part of the code) worked well for me and allowed the smooth import into DOORS. I am new to MS Office automation; thank you for this introduction.
 15-Sep-2005 15:57
User is offline View Users Profile Print this message


Walter Jackson

Posts: 2
Joined: 15-Dec-2004

While trying to import a Word document to DOORS using the "Import to DOORS" toolbar button, I get a VB runtime error 5904 "Cannot edit Range." part way through the import. This seems to be related to the presence of cross references in the document (REF field code), but only if I have the Word options set to not show the field codes (Tools -> Options -> View tab -> Field codes checkbox not checked). Has anyone else experienced this? Are there any other workarounds?
Report this to a Moderator Report this to a Moderator
 15-Sep-2005 16:05
User is offline View Users Profile Print this message


Hubertus Grobbel

Posts: 58
Joined: 3-May-2005

Hi Walter,

yes I had the same experience. Due to the fact, that crossreferences cannot be resolved in DOORS you have to "unkink" them and optionally add some remarks in the text, wich allow navigation to the former references for rework purposes.

Create a macro in Word like the following:

Sub UnlinkReferences()
'
' UnlinkReferences Makro
' Makro aufgezeichnet am 14.09.2005 von Hubertus Grobbel (Fa. ISS+C)
'
'force update

    For Each Feld In ActiveDocument.StoryRanges
        Feld.Fields.Update
    Next

'enable showing field codes

    ActiveWindow.View.ShowFieldCodes = True
    Selection.Find.ClearFormatting
' search for references and insert a working token  like ###
'    With Selection.Find
'        .Text = "^d"
'        .Forward = True
'        .Wrap = wdFindContinue
'    End With

' unlink links means take last valid value
    While Selection.Find.Execute
        Selection.Range.Fields.Unlink
    Wend
' hide field codes (well, there should be none left)
    ActiveWindow.View.ShowFieldCodes = True
       
End Sub


Let me know what you think.

Regards
Hubertus

Report this to a Moderator Report this to a Moderator
 16-Sep-2005 14:34
User is offline View Users Profile Print this message


Walter Jackson

Posts: 2
Joined: 15-Dec-2004

Answer Answer
Thank you Hubertus. This macro (after I removed the comment marks from the "With Selection.Find" part of the code) worked well for me and allowed the smooth import into DOORS. I am new to MS Office automation; thank you for this introduction.
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.