Password protect rtf

meboz

Registered User.
Local time
Tomorrow, 04:32
Joined
Aug 16, 2004
Messages
71
Hi there,

Im trying output a report to a word document, well its actually .rtf format, and then id like to password protect the document.

Heres a snippet of the code, everything works a treat except for the password protection, please help.

Code:
    With DoCmd
        .OpenReport "rptRemMngrSummary", acViewPreview, , "RemMngrID = '" & strFile & "'"
        .OutputTo acReport, "rptRemMngrSummary", "RichTextFormat(*.rtf)", strDir & strFile & ".rtf", False, ""
        .Close acReport, "rptRemMngrSummary"
    End With
    
    Set objDoc = objWord.Documents.Open(strDir & strFile & ".rtf")
    objDoc.SaveAs FileName:=strDir & strFile & "_rpt.doc", Password:=strPassword
    objWord.Documents(1).Close True
 

Users who are viewing this thread

Back
Top Bottom