![]() |
#1
|
|||
|
|||
![]()
Hello All,
Is there any way to export & Import the text strings from .CDR file using Corel Scripts or VBA? Thanks, Shail |
#2
|
||||
|
||||
![]()
Here is a simple way to export the text strings on the current page. Hopefully it will get you started.
Code:
Sub ExportText() Dim s As Shape Open "D:\Temp\MyText.txt" For Output As #1 For Each s In ActivePage.FindShapes(Type:=cdrTextShape) Print #1, s.Text.Story Next s Close #1 End Sub |
#3
|
|||
|
|||
![]()
Hello,
Thanks for the code. I have modified to achieve my requirements. However, stuck in auto generating ID's for id attribute for source element.... Code:
Sub Export2XML() Dim s As Shape Dim xmlFile xmlFile = "D:\Temp\cdrStr.xml" Open xmlFile For Output As #1 Print #1, "<?xml version=" & Chr(34) & "1.0" & Chr(34) & _ " encoding=" & Chr(34) & "UTF-8" & Chr(34) & "?>" '' < add xml-schema if it's needed here > Print #1, "<cdrstrings>" For Each s In ActivePage.FindShapes(Type:=cdrTextShape) Print #1, "<source id="">" Print #1, s.Text.Story Print #1, "</source>" Print #1, "<target>" Print #1, s.Text.Story Print #1, "</target>" Next s Print #1, "</cdrstrings>" Close #1 End Sub |
#5
|
|||
|
|||
![]()
Thanks! my requirement is export the text strings translate it and import back.
Is there any way to import back the strings in .cdr file using the same script. Thanks, Shail |
#6
|
||||
|
||||
![]()
If you use the StaticID in your XML file, then when you need to import the new string you would find the shape with the StaticID and change the text to the new string. It should work just fine.
-Shelby |
#7
|
|||
|
|||
![]()
Thanks a Lot!
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help spliting strings in coreldraw | ashishbindal93 | Macros/Add-ons | 5 | 18-12-2011 00:19 |
Import text file to create shapes | jess916 | Macros/Add-ons | 3 | 12-08-2008 20:21 |
Urgent: Coreldraw 3x: how to export all the pages in .CDR file into one .SVG file | balan | CorelDRAW/Corel DESIGNER VBA | 1 | 21-05-2008 07:47 |
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 12:41 |
Export text file from corel sript?! | ceda | CorelDRAW CS | 0 | 06-06-2003 04:19 |