borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Help with Excel scripting for calculation of a unknown column length)Next Topic (Searching data) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Non-printing Controls
Poster Message
Antares
Level: Graduate

Registered: 29-07-2005
Posts: 9

icon Non-printing Controls

I have a Word document with a button (cmdReset) that I want to appear on the screen but not to print.  Anyone know how to do it?

05-10-2006 at 10:05 PM
View Profile Send Email to User Show All Posts | Quote Reply
LisaM
Level: Trainee

Registered: 02-02-2007
Posts: 1
icon Re: Non-printing Controls

Judging from the date of you post, this probably is too late to be useful to you -- but maybe someone else will find it helpful...

I just did this with some forms by setting the selected text (including cmdButtons) as "hidden" text (select the text, then on Word main menu, Format | Font, then check "Hidden" on the Font tab of the Font dialog box).

Once you have the desired text (and buttons) marked as hidden in the document, add the following code. (Theoretically, only the .View.ShowHiddenText value below should be necessary. However, it seems that periodically opening the form causes the status bar and the scroll bars to disappear. This should not have been happening -- and it was inconsistent and unpredictable -- but since it did seem to be
tied to opening the form, decided to put the following in to override whatever was happening.)


Private Sub Document_Open()
'Display hidden text on screen, but don't print it
    Application.DisplayStatusBar = True 'optional see above
    Application.ShowWindowsInTaskbar = True 'opt see above
    Application.ShowStartupDialog = True 'opt see above
    With ActiveWindow
        .DisplayHorizontalScrollBar = True 'opt see above
        .DisplayVerticalScrollBar = True 'opt see above
        .DisplayScreenTips = True 'opt see above
        .View.ShowHiddenText = True 'required
    End With
    Options.PrintHiddenText = False 'required
End Sub

02-02-2007 at 01:50 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Non-printing Controls
Previous Topic (Help with Excel scripting for calculation of a unknown column length)Next Topic (Searching data) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder