Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Apps

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2011, 07:49 PM
fromb fromb is offline
Junior Member
 
Join Date: Jan 2004
Posts: 16
Default Add Text to Word

How do I add text from a text box in my Delphi app to an existing word document at a specific place in the document? I know how to open the document with;

var Word: Variant;
begin
Word:=CreateOLEObject('Word.Application');
Word.Visible:=True;
Word.Documents.Open(GetCurrentDir+'\Test.docx');

The document is a template on which certain information needs to be automatically entered at different areas on the document with information supplied in text boxes in my app.

Thanks
Reply With Quote
  #2  
Old 12-19-2011, 09:08 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,335
Default

MS Office applications have the ability to record macro's. These are easily translated to Delphi
Reply With Quote
  #3  
Old 12-19-2011, 01:52 PM
fromb fromb is offline
Junior Member
 
Join Date: Jan 2004
Posts: 16
Default Ms Word

Quote:
Originally Posted by Norrit View Post
MS Office applications have the ability to record macro's. These are easily translated to Delphi
Thanks for your reply but I have no idea how to do that, but let me give you a bit more input on my Delphi app; It is a database program where the user (a compressor technician), has to enter information on the job that he has done, after which some of that information needs to appear on a compliance certificate which currently is pre-designed in a word document. Currently the technician types the information directly into the word doc IE the Date, The serial no, etc. This info also has to be saved into my database apps so he has to enter the info twice while if he can enter it only into my apps which would then automatically transfer it to the designated spaces on the word doc, it would save time and less chance for mistakes to happen.

Thanks hope you can help.
Reply With Quote
  #4  
Old 11-01-2012, 09:33 PM
lornemck lornemck is offline
Member
 
Join Date: Jan 2002
Location: Richmond, BC CANADA
Posts: 49
Default

Almost a year late for a reply, but maybe this could be helpful for someone...

I think you're over-complicating the task. Use your application to record the data to the SQL database. Then create a report which generates the required document from the stored SQL data.

This is how accounting packages work... store the invoice data in the database, then print invoices from the stored data one at a time or in batches. Same idea!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:31 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.