OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 05-09-2019, 02:52
default.user default.user is offline
Junior Member
Join Date: Oct 2012
Posts: 5
Default Save file with unicode characters


I've been browsing the forum and the very few other corel VBA related pages in the internet, but I did not find a solution to save and load text as unicode.
My script collects a lot of information in various languages from a large document and when it saves it using
Print #1, "unicode text
all special characters are replaced by '?'
When I switch over to the file object method
objTextStream.WriteLine "unicode text"
The whole line disappears, as soon as it consists of a single special character.

Does anybody have a solution to share ?

Thank you !
Reply With Quote
Old 05-09-2019, 05:09
default.user default.user is offline
Junior Member
Join Date: Oct 2012
Posts: 5
Default Problem is way more complex as I thought

So, I found an other code fragment from an other website.
Dim fsT As Object
  Set fsT = CreateObject("ADODB.Stream")
  fsT.Type = 2
  fsT.CharSet = "utf-8"
  fsT.WriteText t.Text.Story & Chr(10)
  fsT.SaveToFile "c:\temp\fst.txt", 2
I was able to proof this fragment to write special characters when I replace t.Text.Story by 'Ø22'; so I assume that »objTextStream.WriteLine "unicode text"« already did the job as well.
But my real code still does not export special characters, so I've been adding a MessageBox to verify the string before it is written and surprise surprise – the text that is displayed is already wrong !
MsgBox (t.Text.Story)
fsT.WriteText t.Text.Story & Chr(10)
The MessageBox shows '?22' - but the text was 'Ø22' !

Is Corel VBA not compatible to it's own internal data structure, or what went wrong ?

Any help would be much appreciated !
Thank you.

Last edited by default.user; 05-09-2019 at 06:29.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File save with date grzjanik Macros/Add-ons 4 13-07-2012 10:59
save all grouped objects as a cdr file runflacruiser CorelDRAW/Corel DESIGNER VBA 4 26-06-2009 22:55
Save pdf as CorelDraw File Name ProofingGuy CorelDRAW/Corel DESIGNER VBA 8 12-06-2008 10:15
How to import values from a file, replace text,save file for each value with new name amaart CorelDRAW/Corel DESIGNER VBA 1 28-09-2007 13:41
VBA & Photoshop. How Save File anover format? igor___ CorelDRAW/Corel DESIGNER VBA 5 30-11-2006 11:28

All times are GMT -5. The time now is 05:31.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com