Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    save doc file with password.. (2000 sr-1)

    I call this macro with this part of code, is possible to save the doc with passowrd to no permit the modified?
    '''''''''''''
    NOME_MODULO = UCase("1745-1.doc")
    Call SALVA_DOC(NOME_MODULO, cope)
    '''''''''''''

    Sub SALVA_DOC(NOME_MODULO, cope)
    NAMETOSAVE = "GCD01F4500DATIPUBBLICAMODULI_GARANZIESERVIZIO " & cope & "-" & NOME_MODULO & ""
    If Dir(NAMETOSAVE) <> "" Then
    Kill NAMETOSAVE
    End If
    MODULO.ActiveDocument.SaveAs Filename:=NAMETOSAVE
    NAMETOSAVE = Empty
    End Sub

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: save doc file with password.. (2000 sr-1)

    <P ID="edit" class=small>(Edited by sdckapr on 02-Oct-07 06:25. Added PS)</P>How about using the password parameter in the saveas?
    <pre>MODULO.ActiveDocument.SaveAs Filename:=NAMETOSAVE, Password:="MyPassword"</pre>



    Steve

    PS there is also a WRITEPASSWORD parameter for saving changes to the document as opposed to the PASSWORD parameter for opening the document.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: save doc file with password.. (2000 sr-1)

    Hi Steve... tks for code...
    But my idea not is to insert password in open doc, but protect doc for user editing.
    Sorry for wron post.

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: save doc file with password.. (2000 sr-1)

    The WRITEPASSWORD seems to be what you are after.

    Steve

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: save doc file with password.. (2000 sr-1)

    Sal, would you be so kind to post your questions in the appropriate forum? This one is about Word, not about Excel. Even if you call the code from Excel, there is nothing that is specific to Excel.

  6. #6
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: save doc file with password.. (2000 sr-1)

    SORRY AGAIN!... <img src=/S/bash.gif border=0 alt=bash width=35 height=39>
    If you want move for me in appropriate forum.
    Tks.

Posting Permissions

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