Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2021, 03:21 AM
onsight onsight is offline Two macros in one? Windows 10 Two macros in one? Office 2016
Novice
Two macros in one?
 
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
  #2  
Old 03-10-2021, 09:13 AM
Charles Kenyon Charles Kenyon is offline Two macros in one? Windows 10 Two macros in one? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.
Reply With Quote
Reply

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
Two macros in one? How to automatically enable the macros upon opening a file with macros? laurieli Office 7 01-17-2016 08:56 AM
Two macros in one? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft