Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to Word gives 'Access Denied'

Status
Not open for further replies.

SpenBabe

Programmer
Sep 25, 2000
70
0
0
GB
Can anyone help ? Our C++ code uses the Active X control to display our reports. We have the export button enabled on the toolbar & can export fine. We can even export directly into Word (without saving to a disk file first) if the PC has the u2dapp.dll

However, when we try to export through C++ code using the 'Export' method of the Report object, such as :-

VARIANT bPrompt; VariantInit(&bPrompt);

bPrompt.vt = VT_BOOL; bPrompt.boolVal = FALSE;
_bstr_t bsProg = "C:\\Program Files\\Microsoft Office\\Office\\winword.exe";
_bstr_t bsFile = "c:\\temp\\crtest.doc";

m_pIReport->ExportOptions->put_ApplicationFileName(bsProg);
m_pIReport->ExportOptions->put_DestinationType(crEDTApplication);
m_pIReport->ExportOptions->put_FormatType(crEFTWordForWindows);
m_pIReport->ExportOptions->put_DiskFileName(bsFile);
m_pIReport->Export(bPrompt);

We get an exception & then Word fires up with a blank document called 'Document1'

The text part of the comerror says 'Access Denied' - we have tried changing the destination to disk file & it works fine.

Any ideas ?

Spencer Window (not a joke name)
spencer.window@eastmidlandcomputers.ltd.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top