Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Lost code and non functioning userforms in a workgroup template...
I just started working with word 2003 but have coded with vba for a long
time. On this new job I started I inherited a word template that I was asked to add a command button, some drop down features and some textboxes. My question is: Everytime I complile and save the template in the workgroup template area, the word template does not fully function (i.e. the command button generates a userform, but when the userform's option buttons are picked the the userform should change a textbox in the main document - and it doesn't) It will work for me (always) but it will not work for others. It has nothing to do with the macro setting (low). Also I notice my code is missing after the document is saved? I'm perplexed to say the least. Any idea's... -- Otium Cum Dignatie |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Lost code and non functioning userforms in a workgroup template...
Try adding some diagnostics to find where the code is stopping. If the
UserForm comes up, then at least some of your code is working. If the form code is failing, why are there no error messages? 'Code is missing' -- Your code should not be present in any documents anyway. Either it's in the template, or it's in an add-in. BTW: Otium Cum DignITATE "joep3" wrote in message ... I just started working with word 2003 but have coded with vba for a long time. On this new job I started I inherited a word template that I was asked to add a command button, some drop down features and some textboxes. My question is: Everytime I complile and save the template in the workgroup template area, the word template does not fully function (i.e. the command button generates a userform, but when the userform's option buttons are picked the the userform should change a textbox in the main document - and it doesn't) It will work for me (always) but it will not work for others. It has nothing to do with the macro setting (low). Also I notice my code is missing after the document is saved? I'm perplexed to say the least. Any idea's... -- Otium Cum Dignatie |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Lost code and non functioning userforms in a workgroup templat
The problem occus only when another person is using the document so
breakpoints won't work. I believe where ever the coding is being stored is not being saved or not being read by another user. There's something about normal.dot that's probably is not saving my work. One problem I see is that I'm using controls on the document itself. If this is true, how do you launch a userform without using a command button. I also would like to execute subroutines from a form field without using a macro. I'd like to turn macros off and call a routine in a module. Any idea's? -- Otium Cum Dignatie "Jezebel" wrote: Try adding some diagnostics to find where the code is stopping. If the UserForm comes up, then at least some of your code is working. If the form code is failing, why are there no error messages? 'Code is missing' -- Your code should not be present in any documents anyway. Either it's in the template, or it's in an add-in. BTW: Otium Cum DignITATE "joep3" wrote in message ... I just started working with word 2003 but have coded with vba for a long time. On this new job I started I inherited a word template that I was asked to add a command button, some drop down features and some textboxes. My question is: Everytime I complile and save the template in the workgroup template area, the word template does not fully function (i.e. the command button generates a userform, but when the userform's option buttons are picked the the userform should change a textbox in the main document - and it doesn't) It will work for me (always) but it will not work for others. It has nothing to do with the macro setting (low). Also I notice my code is missing after the document is saved? I'm perplexed to say the least. Any idea's... -- Otium Cum Dignatie |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Lost code and non functioning userforms in a workgroup templat
You can use breakpoints other than ctrl-f9s: try debug.print or writing to a
run log. Using controls on the document is usually a bad idea. The more usual approach is to put all your code and forms into an add-in, and provide a toolbar or menu. also would like to execute subroutines from a form field without using a macro. I'd like to turn macros off and call a routine in a module. This makes no sense. Routines, sub or otherwise, ARE macros. Macros are code same as all other routines. Even if the core of your routine is compiled in a DLL, you still need some local code (aka a macro) to call it. And nothing's going to work until you fix the Latin. "joep3" wrote in message ... The problem occus only when another person is using the document so breakpoints won't work. I believe where ever the coding is being stored is not being saved or not being read by another user. There's something about normal.dot that's probably is not saving my work. One problem I see is that I'm using controls on the document itself. If this is true, how do you launch a userform without using a command button. I also would like to execute subroutines from a form field without using a macro. I'd like to turn macros off and call a routine in a module. Any idea's? -- Otium Cum Dignatie "Jezebel" wrote: Try adding some diagnostics to find where the code is stopping. If the UserForm comes up, then at least some of your code is working. If the form code is failing, why are there no error messages? 'Code is missing' -- Your code should not be present in any documents anyway. Either it's in the template, or it's in an add-in. BTW: Otium Cum DignITATE "joep3" wrote in message ... I just started working with word 2003 but have coded with vba for a long time. On this new job I started I inherited a word template that I was asked to add a command button, some drop down features and some textboxes. My question is: Everytime I complile and save the template in the workgroup template area, the word template does not fully function (i.e. the command button generates a userform, but when the userform's option buttons are picked the the userform should change a textbox in the main document - and it doesn't) It will work for me (always) but it will not work for others. It has nothing to do with the macro setting (low). Also I notice my code is missing after the document is saved? I'm perplexed to say the least. Any idea's... -- Otium Cum Dignatie |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Lost code and non functioning userforms in a workgroup templat
I still haven't found my problem but I called microsoft and asked if I could
use controls on a document and they said it was ok. Actually there wasn't any problem with the controls only a problem with my template. When a person chooses a new document based on my template, the expected vba doesn't work. However on exit, if the user chooses no on save the user is prompted again to save the template and if the user chooses yes to save, the expected results are save when the templkate is reopened. I suppose the template should not be prompted to be saved and the new document is not inheriting the code in the template. When I get an answer from MS, I'll forward it. As far as using controls without macros, I tried this and I realize no module procedure can be executed without going through a normal.dot reference. This is dissapointing because if I could run procedures with macros turned off I would not have to worry about viruses and trusted certifigates. -- Otium Cum Dignatie "Jezebel" wrote: You can use breakpoints other than ctrl-f9s: try debug.print or writing to a run log. Using controls on the document is usually a bad idea. The more usual approach is to put all your code and forms into an add-in, and provide a toolbar or menu. also would like to execute subroutines from a form field without using a macro. I'd like to turn macros off and call a routine in a module. This makes no sense. Routines, sub or otherwise, ARE macros. Macros are code same as all other routines. Even if the core of your routine is compiled in a DLL, you still need some local code (aka a macro) to call it. And nothing's going to work until you fix the Latin. "joep3" wrote in message ... The problem occus only when another person is using the document so breakpoints won't work. I believe where ever the coding is being stored is not being saved or not being read by another user. There's something about normal.dot that's probably is not saving my work. One problem I see is that I'm using controls on the document itself. If this is true, how do you launch a userform without using a command button. I also would like to execute subroutines from a form field without using a macro. I'd like to turn macros off and call a routine in a module. Any idea's? -- Otium Cum Dignatie "Jezebel" wrote: Try adding some diagnostics to find where the code is stopping. If the UserForm comes up, then at least some of your code is working. If the form code is failing, why are there no error messages? 'Code is missing' -- Your code should not be present in any documents anyway. Either it's in the template, or it's in an add-in. BTW: Otium Cum DignITATE "joep3" wrote in message ... I just started working with word 2003 but have coded with vba for a long time. On this new job I started I inherited a word template that I was asked to add a command button, some drop down features and some textboxes. My question is: Everytime I complile and save the template in the workgroup template area, the word template does not fully function (i.e. the command button generates a userform, but when the userform's option buttons are picked the the userform should change a textbox in the main document - and it doesn't) It will work for me (always) but it will not work for others. It has nothing to do with the macro setting (low). Also I notice my code is missing after the document is saved? I'm perplexed to say the least. Any idea's... -- Otium Cum Dignatie |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Lost code and non functioning userforms in a workgroup templat
To reiterate what Jezebel told you. Using controls in a document is usually
a bad idea. It requires expert-level programming and still may have unforseen effects. At a minimum, it will activate a macro warning. Ask Microsoft about that when you talk with them. -- Charles Kenyon Word New User FAQ & Web Directory: http://addbalance.com/word Intermediate User's Guide to Microsoft Word (supplemented version of Microsoft's Legal Users' Guide) http://addbalance.com/usersguide See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome! My criminal defense site: http://addbalance.com --------- --------- --------- --------- --------- --------- This message is posted to a newsgroup. Please post replies and questions to the newsgroup so that others can learn from my ignorance and your wisdom. "joep3" wrote in message ... I still haven't found my problem but I called microsoft and asked if I could use controls on a document and they said it was ok. Actually there wasn't any problem with the controls only a problem with my template. When a person chooses a new document based on my template, the expected vba doesn't work. However on exit, if the user chooses no on save the user is prompted again to save the template and if the user chooses yes to save, the expected results are save when the templkate is reopened. I suppose the template should not be prompted to be saved and the new document is not inheriting the code in the template. When I get an answer from MS, I'll forward it. As far as using controls without macros, I tried this and I realize no module procedure can be executed without going through a normal.dot reference. This is dissapointing because if I could run procedures with macros turned off I would not have to worry about viruses and trusted certifigates. -- Otium Cum Dignatie "Jezebel" wrote: You can use breakpoints other than ctrl-f9s: try debug.print or writing to a run log. Using controls on the document is usually a bad idea. The more usual approach is to put all your code and forms into an add-in, and provide a toolbar or menu. also would like to execute subroutines from a form field without using a macro. I'd like to turn macros off and call a routine in a module. This makes no sense. Routines, sub or otherwise, ARE macros. Macros are code same as all other routines. Even if the core of your routine is compiled in a DLL, you still need some local code (aka a macro) to call it. And nothing's going to work until you fix the Latin. "joep3" wrote in message ... The problem occus only when another person is using the document so breakpoints won't work. I believe where ever the coding is being stored is not being saved or not being read by another user. There's something about normal.dot that's probably is not saving my work. One problem I see is that I'm using controls on the document itself. If this is true, how do you launch a userform without using a command button. I also would like to execute subroutines from a form field without using a macro. I'd like to turn macros off and call a routine in a module. Any idea's? -- Otium Cum Dignatie "Jezebel" wrote: Try adding some diagnostics to find where the code is stopping. If the UserForm comes up, then at least some of your code is working. If the form code is failing, why are there no error messages? 'Code is missing' -- Your code should not be present in any documents anyway. Either it's in the template, or it's in an add-in. BTW: Otium Cum DignITATE "joep3" wrote in message ... I just started working with word 2003 but have coded with vba for a long time. On this new job I started I inherited a word template that I was asked to add a command button, some drop down features and some textboxes. My question is: Everytime I complile and save the template in the workgroup template area, the word template does not fully function (i.e. the command button generates a userform, but when the userform's option buttons are picked the the userform should change a textbox in the main document - and it doesn't) It will work for me (always) but it will not work for others. It has nothing to do with the macro setting (low). Also I notice my code is missing after the document is saved? I'm perplexed to say the least. Any idea's... -- Otium Cum Dignatie |