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.
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