web2000 Posted May 11, 2007 Share Posted May 11, 2007 Hello, I am using the COM function to export data from PHP to Word. It works perfectly but the problem i have is that when the files are hosted on a local web server the file opens on the local web server rather than the client machine. Does anyone know how to do this on the client machine? Thanks, here is the code $word = new COM("word.application") or die("Unable to instantiate Word"); $template_file = "C:/letter.doc"; $word->Documents->Open($template_file); $current_date = date("d/m/Y"); $bookmarkname = "TODAYDATE"; $objBookmark = $word->ActiveDocument->Bookmarks($bookmarkname); $range1 = $objBookmark->Range; $range1->Text = $current_date; $word->visible = 1; Quote Link to comment https://forums.phpfreaks.com/topic/50910-com-to-word-problem/ Share on other sites More sharing options...
Daniel0 Posted May 11, 2007 Share Posted May 11, 2007 You'd probably have to use some ActiveX script, but that would only work in IE. The PHP code gets executed on the server, therefore the data handling happens on the server. You could also let the user upload the file, then convert it, then let them download it again. Quote Link to comment https://forums.phpfreaks.com/topic/50910-com-to-word-problem/#findComment-250470 Share on other sites More sharing options...
soycharliente Posted May 11, 2007 Share Posted May 11, 2007 Force them to save the file on their computer before viewing? Quote Link to comment https://forums.phpfreaks.com/topic/50910-com-to-word-problem/#findComment-250476 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.