View Single Post
 
Old 03-30-2021, 02:36 AM
onsight onsight is offline Windows 10 Office 2016
Novice
 
Join Date: Mar 2021
Posts: 9
onsight is on a distinguished road
Default

Ok. Let me explain, what I want to do.

I must have 3 text fields, because I will use this for server based signing word documents. I dont care, what kind of text field. I use ActiveX controls, because I can mask their text like password with ***. If is this possible with Content controls, fine by me. But I dont know, how to do that.

So...in macro I will have several "passwords" saved from several users. Now, 3 random users will type in textfields their passwords. I will not know, who and what. Macro must reveal their passwords and replace this "password" words with correct titles.
For revealing passwords I use this code with checkbox:
Code:
Private Sub CheckBox1_Click()
TextBox1.PasswordChar = IIf(CheckBox1, "", "*")
TextBox11.PasswordChar = IIf(CheckBox1, "", "*")
TextBox12.PasswordChar = IIf(CheckBox1, "", "*")
End Sub

When passwords was revealed, I run macro, that will change this words to proper titles.
Answer from gmaxey working fine, problem is, that I dont know who and in which textbox will write his password. So...Macro must be able to check this too.
Before I use this code:
Code:
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 področje zdravstvene nege " & vbCr & "Mario Dremšak, 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
and work fine but did not work with textboxes.
Now, I have solution from gmaxey, it working fine, but I have to assign all possible options to every box, right?


Now, if anybody understand from my poor english, what I try to accomplish, can you help me? I dont care, if I use something else and not Activex?


TnX
Reply With Quote