Jump to content
Server Maintenance This Week. ×

Create a Word document from FileMaker


Nicolaus Busch

This topic is 3900 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi forum,

I am developing a solution called Litlink used to work with bibliographical data on a rather complex level. What I'm trying to achieve is this: the user has defined authors and books and generated so-called "cards" containing quotations and commentary. He has combined a set of those cards into a project and defined the sort order.

Now I want to create a word document that contains the quotations as a paragraph of the style "Quotation", the commentary as a paragraph with the Style "Standard" and the calculated bibliographical reference as a footnote linked to the quotation.

I saw that the word file format is basically a zip-file that contains among other stuff an XML file where all the real magic is stored, but I have no clue how to produce this.

Has anyone done this before? Any helpful hints maybe or better ideas how to achieve this if not by using XML?

Link to comment
Share on other sites

  • 4 months later...

Scriptmaster has already been suggested as a means of zipping the output. You may want to consider using it with the POI library: http://poi.apache.org/, but its Word support is still minimal for Office 2007.

The new POI preview release supports Office 2007 (OpenXML format); it can read/write Word, Office, and Excel files from Java; so if its jars are registered it opens up some interesting possibilities.

If it isn't essential that Word file generation run on Macs, the use of COM/VBSCRIPT might be considered; easy to read code, easy to generate; total control of content including table generation, etc. http://www.activexperts.com/activmonitor/windowsmanagement/scripts/msoffice/word/ among many other references. To use, place VBScript in a global field, export that field to a file with extension .VBS, and open the file to run it.

An example is attached which generates a simple Word file from Filemaker using a VBScript. If you set filename to .DOC it saves as Office 2003 format; if you set it to .docx, then it saves it in Office 2007/XML format. This runs only on Windows computers.

Generate_Word_File.zip

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 years later...

Hi evyOne;

I m interested by your post and Im happy to found this exempl "geberate word file" , well; In my DB application ,usnig FM pro11, I export records in an .xls file from server ; however , I want to generate Template word file wich conatin records from the excel file ..

I create an excel  macro which do the works ( save records from excel file to word template) But; I want to RUN this "Macro " from the FM DB !! Is that possible?? Thks

Link to comment
Share on other sites

Yes, you can either set up an event to run on open, every time the Excel file is opened, or have the on open event check for a signal file or registry entry to determine whether to run macro.  There is no command line switch to run a macro in MS Excel.  Alternately you can launch a VBSCRIPT which can run the macro.  See http://stackoverflow.com/questions/2050505/way-to-run-excel-macros-from-command-line-or-batch-file Other Office apps, such as Access, DO allow you to run a macro from command line, but not Excel.

Link to comment
Share on other sites

  • 9 months later...
  • Newbies

considering you need to zip a file, i am not sure about whether this word document add-on c# can generate word files like you need. but it is worth a shot.

here is some sample demo codes:

using RasterEdge.Imaging.Basic;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Basic.Codec;
using RasterEdge.Imaging.MSWordDocx;


namespace RE__Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

public static string FolderName = "c:/";

private void button1_Click(object sender, EventArgs e)
{
string fileName = FolderName + "SampleNew.docx";

REDocument doc = new REDocument(1);

REFile.SaveDocumentFile(doc, fileName, new DOCXEncoder());//save new word

}

}
}

Link to comment
Share on other sites

This topic is 3900 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.