Help formatting Excel to Word macro

  • Re: Help formatting Excel to Word macro


    Quote from cytop;616976

    Presumably there is existing code and/or workbooks used to generate these pages...? It would be very helpful if they were attached.


    Yup, sorry about that. This is the non-tweaked by me code that's in the working spreadsheet. My second example is the code I tweaked from a backup.


  • Re: Help formatting Excel to Word macro


    I haven't looked at this yet, will do, but one question first...


    Why don't you design a Word document with placeholders or fields and then do a simple replace of the placeholders in the code?


    Then you're free to redesign the document with no, or minimal, impact on the code.

  • Re: Help formatting Excel to Word macro


    Quote from cytop;616985

    I haven't looked at this yet, will do, but one question first...


    Why don't you design a Word document with placeholders or fields and then do a simple replace of the placeholders in the code?


    Then you're free to redesign the document with no, or minimal, impact on the code.


    Sounds logical, but I have no idea how. I'll Google it to at least get an understanding.


    In the third example the one I'm striving for, I basically "reversed engineered" it in Word. It's the 1st page of a 1200 page document the macro produces using the appropriate member information.

  • Re: Help formatting Excel to Word macro


    The attachment, for example, is a very simplistic lay-out (some fields only). Fields where data needs to be inserted is marked something like '[FULLNAME]',


    You already determine the name so a simple replace of the literal [FULLNAME] with your variable is used to insert data.


    This way, you can redesign the document at will. As long as no new fields are added no other changes need to be made. If new fields are added, the code changes are minor.


    Also, as this may be output as a PDF you can colour it up a little and 'make it nicer' - no problems with it draining your expensive colour inks. If the document is actually printed the user can select to output as black and white.


    My thoughts only. While there's nothing wrong with what you have done, it does seem to be a little limiting, particularly if changes are only being made to the document.

  • Re: Help formatting Excel to Word macro


    Ok, I'm beginning to understand but still haven't a clue as how the macro works to fill the place holders. It's almost time to get up and I haven't been to sleep yet. Let me get some rest and I'll be back.


    Sincerely thanks for your help and patience.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!