Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Delphi Merge with MS Word

Posted on 2004-03-30
6
441 Views
Last Modified: 2010-04-06
Hi,
I am making a program for my As level called Tod's Tyres and it is all about storing information and then invoicing. I was wondering if there was an easy way of transfering data from Editboxes to sections on a MS Word doccument. So forexample like where you have <<Firstname>> on a word doccument it gets replaced by the contents of EdFirstname.text    etc..

Like you do to a memo box, only taking it to a different application.

This would Really help my program as i could have a seperate invoice doccument that i can customise under word. It would also make it much user friendly!

Thanx

Adam
0
Comment
Question by:AdamFred
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
shaneholmes earned 125 total points
ID: 10713993
Check out this site:

http://www.djpate.freeserve.co.uk/AutoWord.htm

There is a tip on how to insert text

Shane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10714027
Also, from this link:  (eugenem)

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20443348.html?query=TWordDocument&searchType=topic

procedure wordReplace( range : Range; source : String; target : Variant );
var
  vFindText, vReplaceWith, vMatchCase, vMatchWholeWord, vReplace : OleVariant;
begin
  if vartype(target) = varNull then target := '';
  vFindText := source;
  vReplaceWith := target;
  vMatchCase := true;
  vMatchWholeWord := true;
  vReplace := wdReplaceAll;
  range.Find.Execute( vFindText, vMatchCase, vMatchWholeWord, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, vReplaceWith, vReplace, EmptyParam, EmptyParam, EmptyParam, EmptyParam );
end;


usage:

d : WordDocument

wordReplace( d.range, 'source', 'target' )

Shane
0
 
LVL 4

Assisted Solution

by:Greg Rowland
Greg Rowland earned 125 total points
ID: 10715719
We accomplished this by creating a document template, containing bookmarks for the data items, then writing to the template bookmarks.

What version of Delphi and word are you targeting?


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question