1 00:00:00,880 --> 00:00:06,759 well in this new video we are going to continue working with macros and with the forms 2 00:00:09,119 --> 00:00:16,199 when you make a macro a form when you come to visual basic and make a form 3 00:00:16,199 --> 00:00:22,899 like the one we have seen in the previous video when we save this is worth this document remember 4 00:00:22,899 --> 00:00:29,280 that you are in word then you have to save this document I will always go to the file to save as 5 00:00:29,280 --> 00:00:36,780 y en el tipo de documento tenéis que ponerle documento habilitado con macros de Word. Si 6 00:00:36,780 --> 00:00:42,479 dejáis la opción que viene por defecto, que es el docx, que es un documento de Word, todas las 7 00:00:42,479 --> 00:00:49,340 macros que hayáis hecho, todas las macros que van incorporadas a ese documento, se van a borrar, 8 00:00:49,659 --> 00:00:55,880 ¿vale? Entonces os tenéis que acordar siempre de documento habilitado con macros de Word, ¿vale? 9 00:00:55,880 --> 00:01:00,679 notice that there are also templates enabled with macros, that is, the macros can be used in many 10 00:01:00,679 --> 00:01:08,439 in many places, but here this second option document enabled with word macros that if 11 00:01:08,439 --> 00:01:18,519 you look at the extensions doc and m is worth the macro not xd of what is the x this is worth doc m 12 00:01:18,519 --> 00:01:28,840 that is that it has the macro ok and once saved if you re-open it it can be for example 13 00:01:28,840 --> 00:01:37,000 to see if now it happens if I come here and I give it to room well here we put hello 14 00:01:37,000 --> 00:01:54,530 happy Sunday click on me well here it does not work if you see that it does not work that is because for security 15 00:01:58,870 --> 00:02:06,870 deactivates the macros then if you see that the macros do not work but you have them here what 16 00:02:06,870 --> 00:02:14,789 you have to do is come to word and in this tool that puts security of macros you click 17 00:02:14,789 --> 00:02:19,289 and here the different options come out you see then it says disable all macros without 18 00:02:19,289 --> 00:02:25,229 notification disable all macros with notification you have to have selected 19 00:02:25,229 --> 00:02:32,729 the one to enable all macros ok and you accept sometimes word for security disables them 20 00:02:32,729 --> 00:02:41,830 then you come to macro security and you enable them ok now once said this we are going to continue 21 00:02:41,830 --> 00:02:50,810 doing some little test with the theme of the maps then look I am going to disable these two 22 00:02:50,810 --> 00:02:59,150 these two objects these two text boxes to disable them we create that we use the 23 00:02:59,150 --> 00:03:11,840 enable then we put it to false and I put it to false there you are in such a way that when I 24 00:03:11,840 --> 00:03:21,780 execute when I start the user phone I cannot write in either of the two ok ok then 25 00:03:21,780 --> 00:03:26,259 what we are going to do now is to continue playing with options of these we are going to put 26 00:03:26,259 --> 00:03:34,180 first this one in the box is worth then this one has here a check box 1 that as we have 27 00:03:34,180 --> 00:03:38,900 been doing you always see that it has its property here capture here I could change 28 00:03:41,699 --> 00:03:51,780 the text then we are going to enable the name for example ok and I am going to put the name 29 00:03:51,780 --> 00:03:58,860 as always in the name and then from the code to make reference to that field then here 30 00:03:58,860 --> 00:04:10,080 we are going to put chk as a check name that is why I put chk of check ok and we are going to do another 31 00:04:10,080 --> 00:04:21,199 control c control v there you are that we are going to call chk 32 00:04:23,319 --> 00:04:37,009 chk last name ok this has gotten smaller and I don't know why we are going to put it well 33 00:04:37,009 --> 00:04:42,550 that everything looks good ok then here instead of enabling the name we are going to go to the caption and I am going to 34 00:04:42,550 --> 00:04:52,269 say that it enables surnames then what is it about because when I click on one of these 35 00:04:52,269 --> 00:05:02,250 options, one or all or none of these fields are enabled, okay if I click on enable 36 00:05:02,250 --> 00:05:08,430 name because I will be able to write the name if I click on enable or enable the 37 00:05:08,430 --> 00:05:12,269 box of the last name because I will be able to write the last name if I click on both 38 00:05:12,269 --> 00:05:17,009 because I can write on both and if I remove the click of the two well then I cannot write in 39 00:05:17,009 --> 00:05:23,850 any ok then the first thing I have to know is how I can ask if there is a if this is 40 00:05:23,850 --> 00:05:31,470 activated or not then if you look there is a property that is value ok then in this case it is not 41 00:05:31,470 --> 00:05:38,829 is a text it is not the value is false but if we put it to true of course what happens 42 00:05:40,529 --> 00:05:46,529 is that it is activated then when this option is activated is that this property is valid 43 00:05:46,529 --> 00:05:53,970 so I already have everything to make my code ok then here what we are going to control 44 00:05:53,970 --> 00:06:00,029 is the event of clicking here on top or clicking here on top ok then we are going to 45 00:06:00,029 --> 00:06:06,569 come first to this for example I double click and it already takes me to the chk click function 46 00:06:06,569 --> 00:06:11,850 name ok because it is the object that we had selected and in which we have double clicked 47 00:06:11,850 --> 00:06:18,629 then what am I going to say here because we are going to say first a question if what there is in chk 48 00:06:18,629 --> 00:06:31,170 name point value value sorry is equal to true what does it mean because you have to activate 49 00:06:31,170 --> 00:06:39,290 this picture ok and how we had called that picture because the txt name is worth it that is why it is very 50 00:06:39,290 --> 00:06:46,509 very important to put the names well then here we are going to put a den ok remember 51 00:06:46,509 --> 00:06:57,470 that that always goes like this and then if it is equal to true then we tell it that txt name point 52 00:06:57,470 --> 00:07:05,129 what property we have used to disable that object of the name in eibol because in 53 00:07:05,129 --> 00:07:19,769 in eibol I tell it to put it to true, it activates it and what happens if when I click here it 54 00:07:19,769 --> 00:07:26,910 is to deactivate it because then chk name point value will be equal to false then how am I going to 55 00:07:26,910 --> 00:07:35,009 do that with the s and this is going to be txt name point in eibol to which it will be equal this well to false 56 00:07:35,009 --> 00:07:44,889 ok ok and this would be my first function ok then I ask a question and enable or disable 57 00:07:44,889 --> 00:07:54,389 depending on the value depending on whether it is activated or not activated ok ok we are going to select the 58 00:07:54,389 --> 00:08:03,149 second now then I double click the same as before and here first I am going to put the value to false 59 00:08:05,009 --> 00:08:11,629 to leave it as it was at the beginning false ok it is already disabled and now I am going to 60 00:08:11,629 --> 00:08:16,509 take all this text ok all these commands and I am going to copy them against the c 61 00:08:18,250 --> 00:08:24,329 against the v and what do I do now I do not want to enable the chk name ok if I leave it like this we would be 62 00:08:24,329 --> 00:08:30,029 working on this object now what I want is to enable the text box of the last name that 63 00:08:30,029 --> 00:08:41,070 was called ch chk ok the question would be about chk last name and what I want to change is the txt 64 00:08:41,070 --> 00:08:58,340 last name ok and here the same we are going to change only this ok then look at how I have the chk last name 65 00:08:58,340 --> 00:09:04,899 on the one hand is worth the name on the other and we are going to see if this works for us or not well we have 66 00:09:04,899 --> 00:09:10,740 our form I can not write in either of the two because there is no enabled enabled 67 00:09:10,740 --> 00:09:19,740 the enable name is now already once it is enabled it lets me write if I disable it you see 68 00:09:19,740 --> 00:09:25,240 that it puts it in light gray that is because it no longer lets me write I enable it again I can 69 00:09:25,240 --> 00:09:30,759 I will write again I can enable here I have done something wrong let's see 70 00:09:30,759 --> 00:09:36,059 pura txt last name 71 00:09:36,059 --> 00:09:41,460 which is what I have done wrong that it is not called last name for sure 72 00:09:42,240 --> 00:09:52,539 last name in plural ok let's put last names and last name and we continue 73 00:09:52,539 --> 00:09:57,700 ok then when I have surnames enabled it lets me write when I disable it it no longer 74 00:09:57,700 --> 00:10:03,500 leaves me ok then this is very comfortable when doing things like this then we can 75 00:10:03,500 --> 00:10:10,220 press it and everything works as we have been doing in the previous example ok 76 00:10:11,539 --> 00:10:18,460 well and this would be this type of objects now this week that enters because in class we will make 77 00:10:18,460 --> 00:10:25,779 un ejemplo como este vale vale pues este vídeo lo dejo aquí un saludo hasta ahora