I'm trying to capture the print event and make a VB Textbox on a word
document invisible while printing, however vb macros does not allow .visible
= false on the text boxes inside of word, anyone know how to do this?
-L
Cindy M -WordMVP- - 12 Aug 2005 09:16 GMT
Hi Locke,
> I'm trying to capture the print event and make a VB Textbox on a word
> document invisible while printing, however vb macros does not allow .visible
> = false on the text boxes inside of word, anyone know how to do this?
What kind of "text box"? There are three or four different possibilities in
word. Which commmand did you use to create it?
And which version of Word are we talking about?
I get the feeling you're talking about an ActiveX control, from the Controls
Toolbox. If that's the case, have you also protected the document as a form?
And is the control in-line with the text, or formatted with textflow
formatting?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
Allan - 13 Aug 2005 03:02 GMT
What is the reason for using the textbox? Does it have buttons in it?
If so you would be better off to place the buttons into table cells an
then make the table row hidden. Place a bookmark into the cell
containing the buttons, loop through the document using something lik
the following:
If ActiveDocument.Bookmarks.Exists("bkButtonPrint") = True Then
ActiveDocument.Bookmarks("bkButtonPrint").Select
'select cell
If Selection.Information(wdWithInTable) Then
Set myrange = Selection.Cells(1).Range
With Selection.Font
.Hidden = True
End With
End If
End If
Once printed, you can turn the buttons back on again
--
Alla