Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Jun 06, 2022 6:47 am

I am creating a document using Spire Doc. The document embed different type of OLE Objects. I'm using following code to embed the object to the document.

Code: Select all
        public void AttachAttachment(FileDownloadResult file)
        {
            try
            {
                DocPicture picture = new DocPicture(_doc);
                Image icon = LoadAttachmentImage(file.Type, file.FileName);
                var imageFileName = DrawFileName(icon, file.FileName);
                icon.Dispose();

                picture.LoadImage(imageFileName);

                _par.AppendOleObject(file.TempFilePath, picture, ToOleObjectType(file.Type));

                File.Delete(imageFileName);
            }
            catch(Exception ex)
            {
                _logger.LogError(ex.ToString());
            }
        }


In above code, I draw the thumbnail on OLE object and attached to the docx as "Attachment -Chinese.png" shown. The Chinese Characters are displayed properly in Word 2013.

However, when I opened the attachment in Word 2013, the thumbnail change to unrecognized string shown as "Attachment - Chinese after open.png".

How can the file name remain unchange when user open the attachment in Word?

ahyanchan
 
Posts: 2
Joined: Mon Jun 06, 2022 6:07 am

Mon Jun 06, 2022 10:00 am

Hi,

Thanks for your inquiry.
According to your description, I used some files with a traditional Chinese name as Ole objects for embedding, but I did not reproduce the problem you mentioned. If you are not currently using the latest commercial version of Spire.Doc 10.5.9, please upgrade and test again.
If this issue persists in the latest version, please email us your complete test code and the test files used. Thanks in advance for your assistance.

By the way, if your native language is Chinese, you can communicate with us directly in Chinese.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Tue Jun 07, 2022 9:54 am

Hi,

Thanks for your sharing.

We did noticed the problem based on your demo and logged this issue in our bug tracking system with the ticket SPIREDOC-7945. We will notify you in time when there is update about it. Sorry for the inconvenience caused.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Wed Jun 08, 2022 8:00 am

Thx you for your prompt reply.

ahyanchan
 
Posts: 2
Joined: Mon Jun 06, 2022 6:07 am

Return to Spire.Doc