Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Open a Word Document with CF

New Here ,
Jul 20, 2021 Jul 20, 2021

Is there a way I can OPEN an MS Word document with CF? I don't want to CREATE one, but only open one that exists already (then let its Autoexec function do a whole lot of stuff with the document).

 

Thanks. -Dale

994
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 20, 2021 Jul 20, 2021

Yes, but it all depends on what you want ColdFusion to do with the .doc or .docx file. You can open an MS Word document in ColdFusion. In ColdFusion, rather than with ColdFusion. So, don't expect ColdFusion to run macros.

 

In ColdFusion, you could then use the Apache POI library, for example, to process MS Word documents. That is what Raymond Camden did over 10 years ago.

https://www.raymondcamden.com/2009/02/04/Reading-Office-documents-with-ColdFusion

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 21, 2021 Jul 21, 2021
Thanks for the response. I don't actually want to open a Word document in Coldfusion. I want Coldfusion to launch MS Word and load a specified document/file. Word will then take over processing the document's Autoexec macro. I don't think what I want is actually do-able in CF, but I want to confirm that.

Thanks again.
-----------------------------------------------
Dale Copps, Library Manager
Creare LLC, 16 Great Hollow Road
Hanover, NH 03755
603 640-2384 fax: 603 643-4657
dgc@creare.com www.creare.com
-----------------------------------------------
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 24, 2021 Jul 24, 2021
LATEST

You could try something like:

<cfexecute name="C:\Windows\System32\cmd.exe"

                  arguments="/c absolute-path-to-winword.exe absolute-path-to-SampleWordDoc.docx">
</cfexecute>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources