Results 1 to 3 of 3

Thread: How can i disable 'SaveAs' and 'Print' option in word document using vb.net

  1. #1

    Thread Starter
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    Question How can i disable 'SaveAs' and 'Print' option in word document using vb.net

    Hello all
    I want to make 'SaveAs' and 'Print' options disable from my document using vb.net, Is it possible ?
    is there any other way to do that ?
    Or how can I stop user from make a copy of document or print it ?

    (If he takes screen shot, no issues)

    Thanks in advanvced
    MCP, MCTS, Microsoft MVP [Asp.Net/IIS]

    For more .NET development tips visit .NET Tips

    If the post is useful then please Rate it

  2. #2
    Member
    Join Date
    Jun 2012
    Posts
    32

    Re: How can i disable 'SaveAs' and 'Print' option in word document using vb.net

    This can be achieved by controlling xml part of your ribbon.

    The code is given below to change the ribbon part

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">
    <commands>
    <command idMso="FilePrint" enabled="false" />
    <command idMso="FilePrintQuick" enabled="false" />
    <command idMso="FileSave" enabled="false" />
    <command idMso="FileSaveAs" enabled="false" />
    </commands>
    <ribbon>
    <tabs>
    <tab idMso="TabAddIns">
    <group id="MyGroup"
    label="My Group">
    </group>
    </tab>
    </tabs>
    </ribbon>
    </customUI>

    You can either write a code in vb.net to control the ribbon or by changing normal.dotm

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: How can i disable 'SaveAs' and 'Print' option in word document using vb.net

    Whats to keep them from copying the file? Remember that anything that is visible on the screen is printable in one way or another. Heck you could even do a screen capture.

    You may be better off adding a watermark to your document
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width