CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2001
    Posts
    1

    MS Word Security

    I have a project that creates a Word document, then it opens it within a web browser control.

    I would like to add some security to these documents by placing a password on them.

    How can I do this through vb code?




  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: MS Word Security

    when you save your document, use saveas method.
    You may add a Password (to open, user will be prompt to insert password) or a
    writepassword (to save changes to original doc, you will have to provide a
    password)
    sintax:
    wapp.Documents("yourdoc").SaveAs FileName, fileformat, lockComments, Password, addtorecent, WritePassword

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured