View Single Post
 
Old 03-10-2021, 03:21 AM
onsight onsight is offline Windows 10 Office 2016
Novice
 
Join Date: Mar 2021
Posts: 9
onsight is on a distinguished road
Default Two macros in one?

I have word file with three textboxes. I use this for "password" signing documents. All three textboxes have masked text for password. When all three workers type their passwords, I unmask their passwords. I use this code for that:


Private Sub CheckBox1_Click()
TextBox1.PasswordChar = IIf(CheckBox1, "", "*")
TextBox11.PasswordChar = IIf(CheckBox1, "", "*")
TextBox12.PasswordChar = IIf(CheckBox1, "", "*")
End Sub


Then I have to copy text to table and with macro convert this "passords" to ordinary text. For that I use this macro:


Sub Podpisi()
With ActiveDocument.Content.Find
.Execute FindText:="winki", ReplaceWith:="V. d. strokovnega direktorja" & vbCr & "Valentina Winkler Skaza, dr. med., spec. psih.", _
Format:=True, Replace:=wdReplaceAll
End With
With ActiveDocument.Content.Find
.Execute FindText:="mario123", ReplaceWith:="Pomočnik direktorja za podrocje zdravstvene nege " & vbCr & "Mario Dremsak, mag. manag., dipl. zn.", _
Format:=True, Replace:=wdReplaceAll
End With
With ActiveDocument.Content.Find
.Execute FindText:="onsightclimb", ReplaceWith:="Bojan Strauss, ZT", _
Format:=True, Replace:=wdReplaceAll
End With
End Sub


This wierd pocedure I have, couse this macro won´t do the trick if passwords are in textboxes. So...I have to unmask passwords first, then copy them in table cells and then run macro, that wil transform password into real name ind title.


Is it possible to somehove combine this two things? Can someone show me, how with one move unmask passwords in textboxes and in the same click also convert password to real name?


I attach the file too.
Attached Files
File Type: docm Doc2.docm (39.1 KB, 8 views)
Reply With Quote