We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Image ZOrder in DocIO

Is it possible to set the ZOrder of an image using DocIO?

Eg.

ActiveDocument.Shapes("MyPicture").Select
Selection.ShapeRange.ZOrder msoBringToFront


4 Replies

JD JBS Developers June 27, 2011 07:49 AM UTC

I was under the impression that the order of the images in the entity collection should be the order in which they appear when opening with word, but when it comes to images this doesn't appear to be the case. If I have an existing document that contains an image in a paragraph and then I open this document using DocIO and attempt to insert an image in the same paragraph at index 0 the new image always appears in front when viewing the document in word after saving.

With other documents I sometimes get the opposite effect, where regardless of what index I insert the image it always appears below the other image in the paragraph even when the first image is index 0 and I insert the new image at index 1.

Looks to me like this might be a DocIO defect.



PR Poornima R Syncfusion Team June 27, 2011 02:53 PM UTC

Hi JBS,


Thank you for your interest in Syncfusion Products.


Regarding “ZOrder for an image in DocIO”, we are analyzing on your requirement. We will update you with more details on this requirement within 1 business day.


Regarding the mentioned issue with “Inserting the image at the specified index of the paragraph does not insert at correct location”, we are not able to reproduce the mentioned issue. We have prepared the simple sample for your understanding. Please find the sample from the below location. Try running the sample and let us know if this helps you.


Sample:
Sample-1359485243.zip


Please modify the above sample to reproduce the mentioned issue on your side. Also please provide us with the generated word document. So that we can analyze the issue further and provide you with clear details.


Please let us know if you have any questions.

Regards,
Poornima




JD JBS Developers June 28, 2011 01:33 AM UTC

I have made some changes to the sample you attached.

From my changes I would expect the hydrangeas image to be hidden by the existing picture as it should have a lower z-order. However regardless of what index I insert the new image it always appears on top.

I should also mention that I am using Office 2003 (SP3) and VS 2010.



Sample_e5dc47fa.zip


PR Poornima R Syncfusion Team June 28, 2011 05:04 PM UTC

Hi JBS,

Thank you for your update.

In the provided sample, the horizontal and vertical alignment of the picture is set as “Centered” with respect to page. This causes the image to be appeared below the existing image (i.e center of the page) in the word document. This is the actual behavior of MS Word and DocIO. For your requirement of inserting the “hydrangeas” image to be hidden by the existing image, we have modified the sample for your requirement. Please find the modified sample from the below link. Try running the sample and let us know if his helps you.

Sample:
Sample-1761394615.zip


Regarding your requirement of “Setting ZOrder position for an image”, currently Essential DocIO does not have a support for setting ZOrder position for an image. We have logged this as a feature request. The feature implementation would greatly depend upon factors like product design, code complexity and compatibility. We do not have any immediate plan to implement this feature. We are sorry for the inconvenience caused.

Please let us know if you have any questions.

Regards,
Poornima



Loader.
Live Chat Icon For mobile
Up arrow icon