Author Topic: Sheet Template File Path Location in API?  (Read 3607 times)

0 Members and 1 Guest are viewing this topic.

ML

  • Guest
Re: Sheet Template File Path Location in API?
« Reply #15 on: May 18, 2007, 10:03:48 AM »

Hey Ron, I didn't try it yet but I was hoping to keep it all within THe VBA Module.
I think Bryon is on the right track, I can try writing the path directly to the registry.
I did fine the exact location of the path in the registry, now I just need to get it there  :|

Mark

ML

  • Guest
Re: Sheet Template File Path Location in API?
« Reply #16 on: May 18, 2007, 10:21:56 AM »

Hey Bryon

I'm sorry, may be it's me but I do not se a sub routine called Registry and I believe the only constant I need  is
Public Const HKEY_CURRENT_USER = &H80000001 for this application. Please correct me if I am wrong.
I'm not even sure that needs to be declared as a constant as I am only using it once in this app.
I can probably just declare is it as a String data type.

I appreciate your help

Mark

Bryco

  • Water Moccasin
  • Posts: 1850
Re: Sheet Template File Path Location in API?
« Reply #17 on: May 18, 2007, 10:44:44 AM »
Mark, if the sub is in the same dvb (project)as the code I said to put in a standard module, when you hit the line
WriteStringValue HKEY_CURRENT_USER, KeyName, valueName, dataValue
it will look for the sub WriteStringValue  and find it in the module, that in turn will look for the Const HKEY_CURRENT_USER,  and find it in the same module.
You can drag out the applicable code to make it smaller but having the whole module is great for doing other work requiring registry writing reading etc.
Api's work a little different than regular code, often you pass them an empty variable, long or whatever and they fill that variable with what you need. But they have a structure that you don't want to mess with. If you copy all the code into one module it will work fine

ML

  • Guest
Re: Sheet Template File Path Location in API?
« Reply #18 on: May 18, 2007, 10:56:08 AM »

Hey Bry

That sounds great and I want to "definetely" take a closer look at The whole project you posted, it is very interesting. However, I don't feel comfortable pasting all of that code into a module and running it when I am not sure of the reprocussions.

That is why I just wanted what I need to get this path into the registry for now.

I am not sure if you can supply just that, but if you can I would very much appreciate it

Thank you

Mark

ML

  • Guest
Re: Sheet Template File Path Location in API?
« Reply #19 on: May 30, 2007, 11:10:55 AM »

Hi Bryon

From what I understand, you can not write to the registry via VBA. Although the code may work successfully and update the registry, AutoCAD has to be open in order to run the module and must once closed will update the registry.

Therefore once you close ACAD, it is going to overwrite your registry entry with the existing path.

Mark