Hi,
RichText rtf
for rtf in szRTF do{
if (rtf.isOle) {
int width, height
clearClipboard()
EmbeddedOleObject ole = rtf.getEmbeddedOle
if( oleCopy(ole) ){
print "Copy OK\n"
}
if( clipboardIsEmpty() ){
print " Clipboard is empty\n"
}
olePaste( oNew )
getOleWidthHeight(ole, width, height)
print("width = " width ", height = " height "\n")
//break
}
}
SystemAdmin - Tue Feb 09 07:36:47 EST 2010 |
Re: oleCopy(ole) RichTextParagraph rp RichText rtf for rp in strRichParaGraphText do { for rtf in rp do{ if (rtf.isOle) { int width, height clearClipboard() EmbeddedOleObject ole = rtf.getEmbeddedOle if( oleCopy(ole) ){ print "Copy OK\n" } if( clipboardIsEmpty() ){ print " Clipboard is empty\n" } olePaste( oNew ) getOleWidthHeight(ole, width, height) print("width = " width ", height = " height "\n") //break } } |
Re: oleCopy(ole) mgomes - Tue Feb 09 07:48:53 EST 2010 I had also used the loops as you suggested but only posted a smaller code snippet. Here's the complete small test code that still always maintains that the clipboard is empty and doesn't paste the OLE object
void checkOLECopy(Object o, string szRTF) {
RichTextParagraph rp
RichText rtf
for rp in szRTF do {
for rtf in rp do{
if (rtf.isOle) {
int width, height
clearClipboard()
EmbeddedOleObject ole = rtf.getEmbeddedOle
if( oleCopy(ole) ){ print "Copy OK\n" }
if( clipboardIsEmpty() ){ print " Clipboard is empty\n" }
olePaste( o )
getOleWidthHeight(ole, width, height)
print("width = " width ", height = " height "\n")
return
}
}
}
}
string szFileName = "D:\\DOORS_OLE_Import\\Import_Small.rtf"
string szRtfData = readFile( szFileName )
Object oNew = create( current Module )
checkOLECopy( oNew, szRtfData )
|
Re: oleCopy(ole) SystemAdmin - Wed Feb 10 01:53:58 EST 2010 I had also used the loops as you suggested but only posted a smaller code snippet. Here's the complete small test code that still always maintains that the clipboard is empty and doesn't paste the OLE object
void checkOLECopy(Object o, string szRTF) {
RichTextParagraph rp
RichText rtf
for rp in szRTF do {
for rtf in rp do{
if (rtf.isOle) {
int width, height
clearClipboard()
EmbeddedOleObject ole = rtf.getEmbeddedOle
if( oleCopy(ole) ){ print "Copy OK\n" }
if( clipboardIsEmpty() ){ print " Clipboard is empty\n" }
olePaste( o )
getOleWidthHeight(ole, width, height)
print("width = " width ", height = " height "\n")
return
}
}
}
}
string szFileName = "D:\\DOORS_OLE_Import\\Import_Small.rtf"
string szRtfData = readFile( szFileName )
Object oNew = create( current Module )
checkOLECopy( oNew, szRtfData )
Try it over an DOORS object with an ole. void checkOLECopy(Object o, string szRTF) { RichTextParagraph rp RichText rtf for rp in szRTF do { for rtf in rp do{ if (rtf.isOle) { int width, height clearClipboard() EmbeddedOleObject ole = rtf.getEmbeddedOle if( oleCopy(ole) ){ print "Copy OK\n" } if( clipboardIsEmpty() ){ print " Clipboard is empty\n" } olePaste( o ) getOleWidthHeight(ole, width, height) print("width = " width ", height = " height "\n") return } } } } Object o = current string szRtfData = richTextWithOle(o."Object Text") Object oNew = create( current Module ) checkOLECopy( oNew, szRtfData ) Perhaps the problem is on the file that you are reading!? |
Re: oleCopy(ole) mgomes - Wed Feb 10 05:29:21 EST 2010 We are using DOORS 9.1 - which version are you using ? |
Re: oleCopy(ole) SystemAdmin - Thu Feb 11 07:27:23 EST 2010 Try to check if there is any patch that correct that error on DOORS 9.1!? |
Re: oleCopy(ole) mgomes - Thu Feb 11 09:08:57 EST 2010 Paul |