Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Input data into a word document

    I've made a db of contacts and clients, but now I've been akes to expand on that. I need it to be able to print the addresses of the people onto labels. I thought it would be easiest to set up a template word document with the margins and spacing set up for the labels, then input the required data. Is this possible. Can you input data into an already created word document and if so, how?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    to do what you want to do
    1)open word and click mail merge (tools>mail merge)
    2) Click create>Mailing Labels
    3) get data>Open data source, locate your file
    4)Then click merge


    scroots
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    But can I automate this througha php script?

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    You can create a Word document via the COM extension though documentation is sparse , if you have already done this sort of thing with VB etc then you would have a head start.

    I cheat and use RichTextFormat , create your document in word and save it as .rtf , anything you want to replace make identifiable, i.e. I use

    "welcome [[NAME]] [[SURNAME]] to the wonderful ...." etc

    then you can open the .rtf in PHP and str_replace your [[$var]] with whatever.

    it takes a bit of messing around but can work out quite nicely.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I also have to make a nice printouts from my database, and I think I'm going to do it with pdf.

    I'm going to use the fpdf library I haven't used it very much, so I can't say how easy/handy it is.
    But you don't need a word on the client pc, only acrobat reader.

    Maybe an idea
    If you don't succeed at first, redefine succes

  • #6
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    if you go the PDF route also look at http://www.ros.co.nz/pdf/ which is a great free PDF library that requires no extensions if your host does not support it , I use it & whilst a little odd its very very useful.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •