<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><title>Opening Word Document</title><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Most of the basics of doing things such as mail-merge etc. haven&#8217;t changed much, the biggest change is in some of the recent security updates in Word. Things like merging a dot file to a docx, can&#8217;t be done, and with some filters installed (the old compatibility ones allowing 2003 to open 2007 files) you can&#8217;t merge a dot to a doc? I have had to tell clients to make dotx and merge to docx only, which gets around some changes in the security of merging with Word 2007.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I tend to CreateOleObject and automate from there, check the version of Word and make any changes necessary dependant on version, I don&#8217;t use the wrappers at all.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards from New Zealand (GMT+12)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Jason Coley<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Software Solutions<o:p></o:p></span></b></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> delphi-bounces@delphi.org.nz [mailto:delphi-bounces@delphi.org.nz] <b>On Behalf Of </b>Cameron Hart<br><b>Sent:</b> Thursday, 19 August 2010 2:56 p.m.<br><b>To:</b> Jason<br><b>Subject:</b> Re: [DUG] Opening Word Document<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I don&#8217;t think Delphi 6 supported Word 2007.&nbsp; Even with BDS 2006 you needed to choose which version of Office you would support when you installed the application, as it could only load one set of components at the same time.&nbsp; You could choose between 2000 and 2003 versions.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Cameron<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Trebuchet MS","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> delphi-bounces@delphi.org.nz [mailto:delphi-bounces@delphi.org.nz] <b>On Behalf Of </b>Eion McIntosh<br><b>Sent:</b> Thursday, 19 August 2010 9:59 a.m.<br><b>To:</b> NZ Borland Developers Group - Delphi List<br><b>Subject:</b> [DUG] Opening Word Document<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I have an application which opens a word template document, makes a connection to the database file and does a mail merge. There is only one record for this mail merge and we have been running this successfully for the last 5-6 years with the app opening the document under Word 2000.</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>We have migrated to Word 2007 and</span> <span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>the mail merging process has changed a bit, so</span> <span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I&#8217;m trying to get the app updated for this. The app opens the document ok, but I can&#8217;t get it to setup the connection to the data source automatically. Under the Mail merge menu option it always wants to be</span> <span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>set up from scratch each time. If I open the document directly from its directory, it makes the connection and works as I want it too,</span> <span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>it&#8217;s only when I call to open the document from within my app it isn&#8217;t making the automatic connection.</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Using Delphi 6</span> <span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>and a TWordApplication component.</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Any thoughts, as I don&#8217;t want to user to have to manually make the connection every time.</span><o:p></o:p></p><p><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Regards</span></b><o:p></o:p></p><p><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>Eion McIntosh | Business Systems Analyst |</span></b><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'> Silver Fern Farms<span style='color:gray'> Limited</span></span></b><br><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>199 - 201 Cashel St</span><b> </b><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>|</span></b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'> PO Box 283, Christchurch 8041, New Zealand</span><b><br></b><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>Tel</span></b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'> +64 3 371 6725</span><b> </b><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>| Fax</span></b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'> +64 3 366 4412</span><b> </b><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>| Mob</span></b> <span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>+64 27 221 1438<br><b>Email</b></span> <a href="mailto:eion.mcintosh@silverfernfarms.co.nz"><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>eion.mcintosh@silverfernfarms.co.nz</span></a><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>&nbsp; Web</span></b> <a href="http://www.silverfernfarms.co.nz/"><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>http://www.silverfernfarms.co.nz</span></a><o:p></o:p></p><p><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:#384802'>Silver Fern Farms - 100% Made of New Zealand</span></b><o:p></o:p></p><p><span style='font-size:7.5pt;font-family:"Arial","sans-serif";color:gray'>This email (including any attachments) is confidential. If you have received it in error, please let us know immediately by return email and delete it from your system.</span><o:p></o:p></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></p></div></body></html>