#1
|
|||
|
|||
How to hide an activeX label in word 2010
Hi,
I'm trying to hide a few of labels when printing if the label caption/text is "Y/N". Below is the code I'm using: Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If lbl_Slave1 = "Y/N" Then Me.lbl_Slave1.Visible = False Else Me.lbl_Slave1.Visible = True End If End Sub Thanks! |
#2
|
|||
|
|||
First off, ActiveX labels in the document do not have a .Visible property.
Secondly you have Cancel and PrintCount as NON-optional parameters, and you have given them no value in the procedure. |
#3
|
|||
|
|||
Hi Fumei,
Thanks for the response. Could you please point me in the right direction if you have an idea on how I can go about accomplishing my mission? Thanks. |
#4
|
|||
|
|||
Catty,
You might make the label caption equal to "" during the print process and then restore it to the y/n state. |
#5
|
|||
|
|||
While making the Caption = "" removes the text, if you also need to make the dimensions small (so the label is no longer taking up space) you can change the Height and Width properties.
Code:
If lbl_Slave1.Caption = "Y/N" Then Code:
With lbl_Slave1 .Height = 1 .Width = 1 .Caption = "" End With End If |
#6
|
|||
|
|||
What the heck. I have tried FIVE times to get proper code blocks. I have used Advanced. I have used copying to Notepad. It insists on ADDING extra code tags (closing after my "Then") and changing font....even though I did NO font changes whatsoever. Even when I click Edit and remove the extra code tags, it puts them back in again.
I give up. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word 2010 Manage Styles dialog and 'Hide Until Used' | Pluviophile | Word | 10 | 11-25-2013 12:40 PM |
Userform label bordercolor not controllable if click label | skarden | Word VBA | 1 | 09-29-2013 07:27 PM |
What label option is being used in this Word doc? | boy33 | Mail Merge | 1 | 01-30-2013 03:11 PM |
Word Form/ActiveX drop down menu/value in a different field | AMackenzieFFCU | Word VBA | 1 | 01-14-2013 07:48 AM |
Need help with placeholder text in ActiveX controls in Word | mhellerstein | Office | 0 | 11-02-2011 12:31 PM |