Opening Word Template Via Macro

  • Hi all i have the code below that opens a word document and then pastes the contents of selected cells in to it, the code works fine, but what i would like to be able to do is open a word template called "Data Letter" stored in My Documents and then paste the cells contents 3 lines down from the header, any ideas?

    Regards,
    Simon

  • Re: Opening Word Template Via Vba?


    Simon


    For the opening part don't you just need to use Add instead of Open and specify the path and filename.

    Code
    With appwd 
            .Documents.Open "C:\My Documents\Data Letter.dot"

    Boo!:yikes:

  • Re: Opening Word Template Via Vba?


    Norie thanks for the quick response!, i'm not sure at all when it comes to manipulating Word, in my code i do have this line

    Code
    With appwd 
            .documents.Add 
            .Selection.TypeText Text:=vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab

    but i use this because when i GetObject or CreateObject there is no documnet sheet so the .Add opens a new page, but like i said i am lost when using vba to control word!


    Regards,
    Simon

  • Re: Opening Word Template Via Vba?


    Norie, thanks for the reply again, how do i get the paste to occur 3 lines down from the header?


    Regards,
    Simon

Participate now!

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