Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table that grows (Office 2000)

    Hi guys,
    I

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Table that grows (Office 2000)

    Are you referring to a table in Word or a table in Access? I presume you meant Tables in Word, which can grow pretty much with no limit. They can span several pages if necessary, though tables that are hundreds of pages can be pretty ugly to deal with. In any event, your probably don't want to send large numbers of pages as a fax cover sheet. Hope this makes sense to you.
    Wendell

  3. #3
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table that grows (Office 2000)

    Hi Wendell Bell!
    You are right, I am refering to a table in word. The maximum row wouldn't exceed 50.
    And yes you are making sense but thats what my boss wants.
    Do you know what I could do to make it grow???

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Table that grows (Office 2000)

    I must confess I haven't tried to add a new row to a table using Automation. But here's how I would tackle it.

    First, I presume your boss want's each transaction in a separate cell in the Word table, and doesn't want any empty rows at the end of the table. If you are typing in Word, all you have to do is press the tab key to add another row, but I don't think you want to try to send key strokes to Word, so try this:
    Create a sample table in a Word document
    Start recording a macro in Word
    Click on the last row of the table
    Choose the Table/Insert Rows After command
    Stop recording the macro and look at the code you generated

    This will have created a new row in the table and positioned the cursor in the new row. You should be able to copy and paste this code into your Access Automation routines, though you will need to modify the object identifiers to be consistent with your existing Access code.

    The correct way to do all this would of course require looking at the Word object model, figuring out all the right methods and actions to use, and then hand coding it. Lazy programmers like me take a path of less resistance however. Hope this helps.
    Wendell

  5. #5
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Urgent VB help needed!

    Ok you guys, I

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Urgent VB help needed!

    Hi,
    I could be wrong, since I don't really use mailmerges a lot, but it seems to me that what you're trying here doesn't really make sense. A mail merge basically involves one document with a few fields that change from record to record (e.g. address fields). What you've got is a mail merge document based on a recordset of customers, but you actually want the document to be different for each customer - you've effectively got a set of records for each customer, rather than one record each, which is how mail merges are designed to work. I think you might be better off using a report/subreport setup for what you're trying to achieve. You can simply force a page break between customers (or funds) so you keep them all separate.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Urgent VB help needed!

    No Rory,
    I don't think you understand. I have fixed columns but the number of records depends every day and that is why I have to create a document where the number of rows could be created to include all the records that needs to be included.
    Believe me when I say "If I could create a report/sub report, I would be very glad to do it but this is what they want and I have to find a way to make it work.
    Don't you think the code would work when put together?

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Urgent VB help needed!

    That's pretty much my point - mail merges produce one document per record. You've got multiple records per customer, so a mailmerge will produce multiple documents per customer. However many trade records you have for each customer (or fund) is how many documents you will get for each customer.
    Since you should be able to make a report look pretty much like your document, your company shouldn't really have a problem with that. Alternatively, you could create a separate summary document or spreadsheet for each customer and fax that along with your fax cover.
    Regards,
    Rory

    Microsoft MVP - Excel

  9. #9
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Urgent VB help needed!

    I am trying to create the fax cover Rory.
    There is a function in word called word merge feilds and its got a function called Next Record and that allows to print more than one record on a page. and that is what am using currently.

    Do u think the codes would work??

  10. #10
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Urgent VB help needed!

    I still don't think it will work because you're trying to create a document that is a form letter and a catalog at the same time. (As I said though, I may be wrong since I don't do this type of thing) I think that your new record field will simply cause Word to repeat everything in your document for the next record - i.e. it will repeat the name and address fields and any text as well.
    Is the code you've got what was created by recording a macro in Word? If so,and the document did what you need, I'm clearly wrong and you can combine catalogs and form letters in one document! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Regards,
    Rory

    Microsoft MVP - Excel

  11. #11
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Urgent VB help needed!

    <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=wrd&Number=97034>This post</A> has just appeared in the Word forum, which sounds very much like what you're trying to achieve. It's probably worth keeping an eye on it! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Regards,
    Rory

    Microsoft MVP - Excel

  12. #12
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Urgent VB help needed!

    Im not trying to create form and catalogue in the same document. This is just a document. When I add the word merge code NextRecord it displays the next record and you could add as many record as you want to your document but the problem is I want to automate this and that is where Im stuck.
    Thanx for trying Rory.
    <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Attached Files Attached Files

  13. #13
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Urgent VB help needed!

    I'll chime in here again and agree with Rory - trying to make Word do this is a major pain. I think it probably can be done with lots of Word code, but that makes it very fragile. I would suggest you use one of two alternatives.
    <UL><LI>Do as Rory suggests, and create a report that does that - it's much easier than messing with mail merges, and then export it to an RTF file which you can fax.
    <LI>Look at the Access Developer's Handbook (Getz, Litwin, et.al.) where they give an example of how to create a complex Word document using bookmarks and other Word tricks, but doing in using Automation from Access.[/list]I write lots of VBA code, and have for many years, and the largest module I have ever created is about the same size as what you have here. Big modules are always a cause of problems.

    A couple of comments: Do you only send one fax at a time, and is that part automated as well? Using a catalog style merge is intended to create only one document, but I can't tell from your code if you are actually creating more than one document. It appears you are saving the document so it probably is not being sent automatically. If you are creating more than one document, the first approach would probably be pretty ugly, and the better choice would be the Word Automation that creates a document and doesn't do MailMerge.
    Wendell

  14. #14
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Urgent VB help needed!

    Wendell, PLEASE do have a look at the attachment on the previous post.
    That is the document I am creating with the codes the I have included in the previous posts.
    What I was hoping to do was to create the table or add rows automatically but it seems very hard. I don't know what to do. <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

  15. #15
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Urgent VB help needed!

    Ok, If thats not possible, How about this:
    I could merge to a catolog and the automatically copy it and paste it onto my Fax cover sheet??

Page 1 of 2 12 LastLast

Posting Permissions

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