Exporting an RTF file to SharePoint

gblack

Registered User.
Local time
Today, 00:23
Joined
Sep 18, 2002
Messages
632
OK I have a process which exports a report to a SharePoint site.

This process works fine as so:

DoCmd.OpenReport "00100_Rpt_Document(Draft)", acViewPreview, , , , intAgreementID
DoCmd.OutputTo acOutputReport, "00100_Rpt_Document(Draft)", acFormatPDF, "http://sps.itil.cit.nih.gov/SLADrafts/" & strSLAName & ".pdf", False

DoCmd.Close acReport, "00100_Rpt_Document(Draft)"

That is to say a PDF file is exported to SharePoint with no issues. AND... when I try this:

DoCmd.OpenReport "00100_Rpt_Document(Draft)", acViewPreview, , , , intAgreementID
DoCmd.OutputTo acOutputReport, "00100_Rpt_Document(Draft)", acFormatRTF, "D:\SAMS\CF_EOF_XX\" & strSLAName & ".rtf", False
DoCmd.Close acReport, "00100_Rpt_Document(Draft)"

It pushes an RTF formatted report out just fine to the spcified location on the server...HOWEVER WHEN I DO THIS:

DoCmd.OpenReport "00100_Rpt_Document(Draft)", acViewPreview, , , , intAgreementID
DoCmd.OutputTo acOutputReport, "00100_Rpt_Document(Draft)", acFormatRTF, "http://sps.itil.cit.nih.gov/SLADrafts/" & strSLAName & ".rtf", False
DoCmd.Close acReport, "00100_Rpt_Document(Draft)"

The report won't post to the SharePoint site, although I have manually uploaded an RTF document to that very site and had no issues... but for some reason MS Access' export command isn't working for the RTF like it is for PDF exports.


Anyone have any clue what might be going on here?
 
RTF's are so outdated ;-) but I just tried it and was able to output to our sharepoint site using the same method as yours. No need to open and then close the report, just use the DoCmd.OutputTo command to send your report.
 
Hmm... that wierd. I have no idea then why it won't post to SharePoint. It won't post to SharePoint in any method other than a PDF... txt, rtf, html... none of them will post. I asked the SharePoint guy and he had no idea why this was happening...


As far as not having to open the report first:

I open the report and then close it after, because I have to pass the report the intAgreementID arg.

The report creates a document based off the value of the intAgreementID (obtained from a form with a button's "on click event procedure" kicking off the report [i.e., runs the code I posted]).

I thought by opening the report first it would allow all the VBA code to run using that arg in the on open even procedure of the report itself. That appears to be what is happening. So is there a way to push the args through the export method directly and have the report run that VBA code prior to export without me actually having to open it first? Seems like a clunky process...If you know of a way I can streamline it, I am all ears...

Thanks,
Gary
 

Users who are viewing this thread

Back
Top Bottom