Full Version: Macro question for Carl

From: laserman (MIKEMAC) [#1]
 26 Jan 2007
To: ALL

Carl,

I hope you will read this, I know you are really good at creating Macros for Corel so I would like to get your opinion.

I have a customer that needs to print date codes onto parts that is not that difficult to figure out however what they would like to do is to use the date from windows.

So is it possible to create a macro that will pull the date from windows and insert it into a file within Corel?

The reason is they want to take all of the risk factor away from the operator.

once the computer is turned on then that date becomes the data that will be printed onto there product. If they then go away for a week and then come back in and turn on the system they would want it to print that current date.

Does this make sense?

Could you please advise if this is possible?

If it is possible They would be willing to pay someone for there time in setting this up.

Thanks!


From: Carl (CSEWELL) [#2]
 26 Jan 2007
To: laserman (MIKEMAC) [#1] 26 Jan 2007

Absolutely possible. Do you want it in a specific spot? I've attached a macro that uses the bounding box macro and inserts the CorelDraw filename (if the file has been saved), the current time, and current date into the lower right-hand corner.

Too much?

I use this macro to timestamp my CorelDraw files and then I print out a copy to put into a 3-ring binder. Sometimes it is easier to leaf through these pages than try to remember the name or location of a file.

From: Dave Jones (DAVERJ) [#3]
 26 Jan 2007
To: Carl (CSEWELL) [#2] 26 Jan 2007

Can a macro be made to automatically run when a drawing is opened, without the operator having to do something to trigger the macro?

If not, then it seems like they are still dependent on the operator doing something to make sure the current date is there. (in this case, running the macro)


From: Carl (CSEWELL) [#4]
 26 Jan 2007
To: Dave Jones (DAVERJ) [#3] 26 Jan 2007

quote:
Can a macro be made to automatically run when a drawing is opened, without the operator having to do something to trigger the macro?


Yes, but then you have to count on the operator to turn on the computer and a dozen other things.......

;^)

From: laserman (MIKEMAC) [#5]
 26 Jan 2007
To: Carl (CSEWELL) [#3] 26 Jan 2007

Yes Carl there will be a specific location, And like Dave mentioned we would like it to activate via an icon on the desktop.

Example: turn on computer double click icon opens corel file runs macro loads data into specific location.

They would also need a specific format for the data something like
012607.

Does this make sense. And thank you very much for your response.


From: Carl (CSEWELL) [#6]
 26 Jan 2007
To: laserman (MIKEMAC) [#5] 26 Jan 2007

Yes, all of that is possible. I haven't verified it all but I don't see any problems.

The CorelDraw file would be used as the icon on the desktop which should open when the operator double clicks on it. The macro would execute (Corel will have to be configured for this.... a couple of steps) and insert the date in the desired format. It could be hard-coded, ie it would always place the date in the position specified by the macro, or it could look for a specific string to replace or an object name to be replaced.

It's not going to be totally foolproof. They are making fools way too good these days..........

From: Shaddy [#7]
 26 Jan 2007
To: Carl (CSEWELL) [#6] 26 Jan 2007

If they're always using a template of sorts, same pieces in the same place, and the text boxes are already set up and formatted, you can just use the Name feature of the object (change the name of the text box to something like TodaysDate), then set the new selection to everything with that name, then change the text value.

That frees them up to add to that template and move everything around. And if they don't want the date in a particular item anymore, they just rename it to something different.

Shaddy


From: laserman (MIKEMAC) [#8]
 26 Jan 2007
To: Carl (CSEWELL) [#6] 26 Jan 2007

Carl,

I hear that! the method of hard coding it would be the best that way no one would have access to change it and screw things up.

If you would like to take on this challenge Please send me a pm and I will be sure to compensate you for your efforts.

Thank you!!


From: Carl (CSEWELL) [#9]
 26 Jan 2007
To: Shaddy [#7] 26 Jan 2007

quote:
That frees them up to add to that template and move everything around.


And totally screw up everything!! ;^)

Yes, ideally that would be nice and can be done, but once you give someone that 'freedom', you are free to become the end of that word. I worked in manufacturing for far too many years.........

And, besides, if you give them all that flexibility, they won't have to come back to you for macro changes! ;^)

From: laserman (MIKEMAC) [#10]
 26 Jan 2007
To: Shaddy [#7] 26 Jan 2007

Shaddy,

This will be on going for years these parts are injection molded and are required to have a date engraved onto everyone the dates will stay the same for the run ie start at 8:00 am on 1-26-07 and end at 5:00 on 1-26-07 everything that is produced during that time frame must have a date code of 12607. When they come in the next morning 1-27-07 everything molded on that day must have a new date code (12707).

This is why we want to automate it to change the date code using the computer clock.

The parts will always be in the same location and the date code will always be in the same position.

We have had special fixturing machined and mounted to the laser so that the robotic arm will insert and remove the molded parts automatically this is already done its now just a matter of changing the date code automatically


From: Harvey only (HARVEY-ONLY) [#11]
 26 Jan 2007
To: laserman (MIKEMAC) [#10] 26 Jan 2007

Some of the older programs I used had the ability to insert a code that put in today's date. I cannot find it in Corel X3. Bad to have that feature omitted.

From: Dave Jones (DAVERJ) [#12]
 26 Jan 2007
To: Harvey only (HARVEY-ONLY) [#11] 26 Jan 2007

A feature like that would have to not only insert the date automatically, but allow a full custom date format in order to meet the non-standard format he needs.

From: Carl (CSEWELL) [#13]
 26 Jan 2007
To: Dave Jones (DAVERJ) [#12] 26 Jan 2007

That's a fairly standard format. Most commercial software allows you to specify date fields in an MMDDYYYY format. VBA supports that also.

From: Dave Jones (DAVERJ) [#14]
 26 Jan 2007
To: Carl (CSEWELL) [#13] 26 Jan 2007

Well the VBA Format() funtion can certainly format date strings to user specs, but I was thinking more about the built in current date string that a lot of programs provide. Most of those that I've seen only offer standard US and European date formats.

From: Carl (CSEWELL) [#15]
 26 Jan 2007
To: Dave Jones (DAVERJ) [#14] 27 Jan 2007

If you want to get down to the system level, Windows operating systems allow you to specify the date format (as in mmddyyyy, or whatever) that application software will use for the default, provided they are using operating system calls to get the date, of course. It surprised me that that functionality existed in Windows.

From: logojohn [#16]
 27 Jan 2007
To: laserman (MIKEMAC) [#10] 29 Jan 2007

quote:
12607


Couldn't that be 1-26-07
or 12-6-07
Might help to field fill with zeros
012607
120607

Back to thread list | Login

© 2024 Project Beehive Forum