excel - Sending commands across VBA -


i writing script in vba creates drawing in coreldraw. having trouble centering text. here code works in coreldraw's macro editor:

dim s2 object     dim txt object     dim test string     dim returntest string     returntest = "test~test1234~test56~test789"     test = replace(returntest, "~", chr(13))     set s2 = corelapp.activelayer.createartistictext(-7.75, (1 - 0.5) / 2, test)     set txt = s2.text     txt.story.font = "swis721 bt"     txt.story.size = 20     txt.story.linespacing = 75     txt.story.alignment = cdrcenteralignment     s2.fill.uniformcolor.cmykassign 0, 0, 0, 100     s2.outline.setnooutline     s2.centerx = s1.centerx     s2.centery = s1.centery 

s1 rectangle defined. problem "cdrcenteralignment". vba not recognize valid argument because referencing exists within coreldraw. "cdrcenteralignment variable not defined" or "type mismatch" if call string. how, if possible, can send command/argument coreldraw while still working in excel?

i ran similar problems sending same drawing autocad able work around sending things command line.

in vba code can define yourself:

const cdrcenteralignment = 3 

https://community.coreldraw.com/sdk/api/draw/19/e/cdralignment


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -