Jump to content

Generating Excel files for adresses and import to Word


Akira

Recommended Posts

Hey guys,

Im trying to create a excel file from PHP and import this to Word.
How can this be done??

I've tried 2 different methods so far.
1. genarating and XML file and saving it as Excel
2. generating a full workbook, also with the help off XML

A piece of the code

[code]<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>11910</WindowHeight>
  <WindowWidth>15195</WindowWidth>
  <WindowTopX>480</WindowTopX>
  <WindowTopY>60</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
  <Style ss:ID="Default" ss:Name="Normal">
  <Alignment ss:Vertical="Bottom"/>
  <Borders/>
  <Font/>
  <Interior/>
  <NumberFormat/>
  <Protection/>
  </Style>
</Styles>
<Worksheet ss:Name="Blad1">
  <Table ss:ExpandedColumnCount="10" ss:ExpandedRowCount="<?=count($_POST['id'])?>" x:FullColumns="1"
  x:FullRows="1">
  <Column ss:Index="9" ss:Width="52.5"/>
  <Row>
    <Cell><Data ss:Type="String">voorletters</Data></Cell>
    <Cell><Data ss:Type="String">tussenvoegsel</Data></Cell>
    <Cell><Data ss:Type="String">achternaam</Data></Cell>
    <Cell><Data ss:Type="String">adres</Data></Cell>
    <Cell><Data ss:Type="String">huisnr</Data></Cell>
    <Cell><Data ss:Type="String">toevoeging</Data></Cell>
    <Cell><Data ss:Type="String">postcode</Data></Cell>
    <Cell><Data ss:Type="String">woonplaats</Data></Cell>
    <Cell><Data ss:Type="String">telefoon</Data></Cell>
    <Cell><Data ss:Type="String">e-mail</Data></Cell>
  </Row>[/code]

But Word doenst see it as a legal document.

Can someone help me with this, need to have this done by tonight 00.00 :|

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.