OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 20-11-2010, 08:25
0meg@ 0meg@ is offline
Member
 
Join Date: Nov 2010
Posts: 37
Default Scripts inside VBA Corel Macro?

Question: can i use for example WSH call or even more! assembler directives inside my macro. I believe i can, but don't know how.
Reply With Quote
  #2  
Old 20-11-2010, 10:30
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Wsh

WSH should work fine, I have never tried anything in assembler.

-Shelby
Reply With Quote
  #3  
Old 13-12-2010, 02:09
0meg@ 0meg@ is offline
Member
 
Join Date: Nov 2010
Posts: 37
Default

How can i use SetLocale from WSH in my VBA for Corel Macro. The reason is too large code to change locale by VBA.
Reply With Quote
  #4  
Old 14-12-2010, 06:41
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Just curious, why do you need to change the locale?
Reply With Quote
  #5  
Old 16-12-2010, 03:44
0meg@ 0meg@ is offline
Member
 
Join Date: Nov 2010
Posts: 37
Default

I working in Russia, some of designer's computers en locale and other ru locale but all of them use some net folder named in english with month's name. My macro for automation builds the path and the code in WSH is:


strPath2Lnk = objFSO.BuildPath(objWshShell.SpecialFolders("SendTo"), "Send to NetPrinterFolder.lnk")

prevLocale = SetLocale("en-us")
dtNow = Now()
strTargetPath = objFSO.BuildPath( _
"\\Print\Work", Right("00" & CStr(Month(dtNow)), 2) & "_" & MonthName(Month(dtNow)) & "\" & Right("00" & CStr(Day(dtNow)), 2) _
)
SetLocale(prevLocale)


But there is no simple way to change locale in VBA for my purpose.
Reply With Quote
  #6  
Old 25-12-2010, 15:57
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Since you are always using English month names, why not just hard-code them like this:

Code:
Function EnglishMonthName(ByVal nMonth As Long) As String
    Dim monthNames() As Variant
    monthNames = Array("January", "February", "March", _
            "April", "May", "June", "July", "August", _
            "September", "October", "November", "December")
    
    EnglishMonthName = monthNames(nMonth - 1)
End Function
Then you can use this function instead of VBA's MonthName
Reply With Quote
  #7  
Old 26-12-2010, 00:08
0meg@ 0meg@ is offline
Member
 
Join Date: Nov 2010
Posts: 37
Default

Thank you, i was trying to decrease code.
Reply With Quote
Reply


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
Photo-Paint Scripts pudo Corel Photo-Paint CS 1 13-07-2005 11:48
How to use old scripts (.CSC) with CorelDRAW? Alex FAQ 1 24-05-2005 10:51
Corel 12 Scripts garyallred Macros/Add-ons 1 12-02-2004 15:49
Trying to make buttons from my scripts click101 CorelDRAW/Corel DESIGNER VBA 0 10-09-2003 10:41
Can scripts be upgraded? Wild_Weasel CorelDRAW/Corel DESIGNER VBA 1 14-01-2003 15:30


All times are GMT -5. The time now is 19:58.


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