How to copy text & non text content from clipboard and paste it into REQ description field of HP Quality Center?
Question ID: 108419
0
0

Hi Peers,

Using Word objects in VBA, I am opening word document and then I am Iterating through all the list items ( Heading Names) having different heading styles present in the Word Navigation Panel.

For each heading I am extracting the heading Name and its residing content.

Now, for each heading I want to create a REQ in ALM, where the REQ name will be Heading Name and REQ descrition content will be the data residing with in the heading ( Data might be text or html or pictures or mixed ).

I am successful till the point where I am to copy the data residing for each heading but post that I am not able to figure out how to paste this content (text + non text ) into REQ description while creating a new requirement.

Below code is returning only TEXT but not formatting, I want formatting as – is like present in the source.

oWord.Selection.Copy
Set myreq1 = RFact.AddItem(myreq.ID)
myreq1.TypeId = "Folder"
myreq1.Name = strText
Dim Capture_Clipboard_Content As Word.Selection
Set Capture_Clipboard_Content = oWord.Selection
myreq1.Field("RQ_REQ_RICH_CONTENT") = Capture_Clipboard_Content
myreq1.Post

Regards,Srihari

Marked as spam
Posted by (Questions: 33, Answers: 21)
Asked on May 23, 2018 1:17 pm
48 views
Answers (1)
0
Private answer

Hi Sai,
I don't see how you can accomplish what you are wanting as Word is using a markup language for its formatting and the str content is only able to handle ascii characters, of which many of the Word markups are not a subset of therefor you would get a truncate or type mismatch on the system when trying to save into that defined variable. I think you would need to try and include a screen shot or attachment of the original document to refer to or have an instruction to refer to said document from within the requirement or manually enter the data in as you would like it to be displayed, as the current design is not able to handle the request as desired.

Dan

Marked as spam
Posted by (Questions: 0, Answers: 770)
Answered on August 8, 2018 1:25 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top