#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
Offhand, I would recommend replacing the specialized IFF with IF...THEN...ELSE.
IIF vs. If...Then...Else in VB, VBA, and VB .NET I do not think this answers your question, though. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Security warning bar for macros, without any macros | ACA | Word | 1 | 10-04-2020 11:32 AM |
How to automatically enable the macros upon opening a file with macros? | laurieli | Office | 7 | 01-17-2016 08:56 AM |
VBA macros | tays01s | Word VBA | 6 | 08-03-2011 09:42 PM |
Macros | nore | Outlook | 0 | 06-01-2011 04:39 PM |
Macros | Steveg | Word VBA | 0 | 08-18-2010 04:04 PM |