Re: Creating Word docs in 4D

2019-04-05 Thread Ingo Wolf via 4D_Tech
Hello David,

I do something similar, generically for .docx, .xlsx and so on:

-Unzip the file, which creates a number of folders and files
-Replace the embedded variables with data (freely configured in a report 
template: which document (docx, .xlsx), which variabes with which contents in 
which files)
-Zip the file, using 7zip from the command line
-Change the extension to .docx or similar

Greeting
Ingo

>Is anyone using the following methodology to do this?:
>Outside of 4D:
>1. Create a template in MS Word, with home-grown embedded variables, and save 
>it as a .docx file. (Which is actually a zipped collection of xml and other 
>files.)
>2. Change the file extension to .zip .
>3. Unzip the file, which creates a number of folders and files.
>
>In 4D:
>1. open the resulting document.xml file.
>2. Replace the embedded variables with data.
>3. Resave the file.
>4. Zip the file, using Miyako's zip plugin for 4D.
>5. Change the extension to .docx .
>
>Anyone doing this or something like it?
>
>David


-- 
ViELMAC Ingo Wolf
Rheinhessenring 53A
D 55597 Wöllstein
Tel. +49 (0)6703 3070320
Fax  +49 (0)6703 3070321
e-mail i...@vielmac.de
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Creating Word docs in 4D

2019-04-05 Thread Epperlein, Lutz (agendo) via 4D_Tech
We do that nearly the same way, with the difference that we don't use 4D Write 
or Write pro. And for Zipping and unzipping we use PHP.

And with 4D 17R4 it should possible to export from Write Pro to docx.

Regards
Lutz

> -Original Message-
> Subject: Creating Word docs in 4D
>
> As of August 2018, Write Pro could not export to a Word doc. Has that 
> changed?
>
> I have a 4D v15 application that uses 4D Write pre-defined templates that 
> contain
> home-grown embedded variables, and the code uses the WR Replace command to
> substitute data for these variables.
> Then the Write docs are exported as Word docs. Works perfectly.
>
> But in v17, I have to come up with a way to replicate this functionality.
> Is anyone using the following methodology to do this?:
> Outside of 4D:
> 1. Create a template in MS Word, with home-grown embedded variables, and 
> save it as
> a .docx file. (Which is actually a zipped collection of xml and other 
> files.)
> 2. Change the file extension to .zip .
> 3. Unzip the file, which creates a number of folders and files.
>
> In 4D:
> 1. open the resulting document.xml file.
> 2. Replace the embedded variables with data.
> 3. Resave the file.
> 4. Zip the file, using Miyako's zip plugin for 4D.
> 5. Change the extension to .docx .
>
> Anyone doing this or something like it?
>
> David
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Creating Word docs in 4D

2019-04-04 Thread David Rose via 4D_Tech
I found another solution, pending some testing. (This is in a Windows 
environment, btw.)
Print the Write Pro document to a PDF file (in my case, using Microsoft Print 
to PDF), then use a command-line utility that converts PDFs to Word, like Total 
PDF Converter from coolutils.com. This app costs $39, but there are probably 
some free apps out there as well that do the same thing. Command-line utility 
programs can be launched from 4D by creating a .bat file and launching it via 
LAUNCH EXTERNAL PROCESS.
Will experiment and report back. Will be interesting to see how accurate the 
resulting Word docs are compared with the PDF files.
David

-Original Message-
From: David Rose [mailto:drose...@gmail.com] 
Sent: Thursday, April 04, 2019 10:09 AM
To: '4d_tech@lists.4d.com' <4d_tech@lists.4d.com>
Subject: Creating Word docs in 4D

As of August 2018, Write Pro could not export to a Word doc. Has that changed?

I have a 4D v15 application that uses 4D Write pre-defined templates that 
contain home-grown embedded variables, and the code uses the WR Replace command 
to substitute data for these variables.
Then the Write docs are exported as Word docs. Works perfectly.

But in v17, I have to come up with a way to replicate this functionality.
Is anyone using the following methodology to do this?:
Outside of 4D:
1. Create a template in MS Word, with home-grown embedded variables, and save 
it as a .docx file. (Which is actually a zipped collection of xml and other 
files.) 2. Change the file extension to .zip .
3. Unzip the file, which creates a number of folders and files.

In 4D:
1. open the resulting document.xml file.
2. Replace the embedded variables with data.
3. Resave the file.
4. Zip the file, using Miyako's zip plugin for 4D.
5. Change the extension to .docx .

Anyone doing this or something like it?

David



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**