+ Reply to Thread
Results 1 to 5 of 5

line spacing incorrect when copying to word 2010

  1. #1
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    line spacing incorrect when copying to word 2010

    Hi, I've posted a similar request before but not been able to sort this problem out probably because I hadn't explained the problem well enough.
    I have some code which generates invoices by populating cells in excel then copies the excel worksheet into a word document, when running it generates dozens of invoices at a time.
    It runs fine in office 2003 but since converting to office 2010 the line spacing on the word document is double spaced (or maybe more) which is clearly incorrect.
    I cannot post the whole workbook as it contains sensitive information so I have created a stripped down version attached which will run and generate a single test invoice to illustrate the problem.
    Can anyone who is running office 2010 help to modify the code to correct this error or point me in the right direction to change the word line spacing.

    Code within the workbook is:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Re: line spacing incorrect when copying to word 2010

    I have been trying to solve this (unsucessfully) by recording a macro in word which has the code below, unfortunately it falls down on the first line
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: line spacing incorrect when copying to word 2010

    Tryer

    I looked at your code but I couldn't see the problem.

    That's probably because I don't know what the Word document should look like, where the spacing is wrong etc.
    If posting code please use code tags, see here.

  4. #4
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Re: line spacing incorrect when copying to word 2010

    Hi Norie,

    Thanks for the answer. The problem is on the word docu,ment the line spacing appears double spaced which spreads a single page over two. After much experimenting I have found a possible cause and a workaround solution. Apparently in office 2007 onwards microsoft changed the default line spacing for new documents. I have found that by changing the default style in word to 2003 all works OK. It's not really the best solution as it would be better for the code to be able change the line spacing as it creates the documents but in the absence of any other solution at least it works.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: line spacing incorrect when copying to word 2010

    Have you considered using a template rather than starting with a blank document?

    It could be setup to have the required line spacing and anything else that might be useful.

    Perhaps even a form/ table so you can put the data in the right place.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1