> yes shape is a variable of type Shape Object name in Word Object
> Model. Its just an instance of Words InlineShape type.
> It wont produce any compilation errors.
> shape.Copy() copies the shape (Inline or other shape) to Clipboard.
> and we fetch the same but when used inside child thread its not
> working.
Nevertheless, it is bad practice to create variables bearing the same name
as reserved keywords.
Try changing the name, and even if it does not help, you should still change
the name becasue it is a bad idea to keep that name.
Maybe that in the child thread the compiler has difficulty resolving the
name...
Especially since you are using "shape" for an InlineShape, which are totally
different from Shapes. The compiler may react differently with this when you
are calling it in the child thread.
But I am now confused, you state:
"shape is a variable of type Shape Object name in Word Object Model. Its
just an instance of Words InlineShape type"
and then you go on to write:
"shape.Copy() copies the shape (Inline or other shape)"
So, which is it, shape or inline shape? They are different beasts. Depending
on how you create the instance, you may hve a problem. Is "shape" declared as
an Object , a Shape or an InlineShape?
miztaken - 11 May 2008 07:24 GMT
Hi Jean..
Ok i think i confused myself and you as well.
here is the code of that i am doing:
foreach (MsWord.InlineShape wordshape in doc.InlineShapes)
{
if(wordshape.Type==WdInlineShapeType.wdInlineShapePicture)
{
wordshape.Select();
wordshape.Application.Selection.CopyAsPicture();
IDataObject ido = Clipboard.GetDataObject();
}
}
here if i run this code (other supporting codes as well) in primary
thread then ido returns the Object but when its ran on child thread
then ido returns null.
I hope this is clear now.
Help me
miztaken