Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

How runing word files from Excel with VBA codes

5 réponses
Avatar
Eric
hi everybody,

I am trying to fulfill some contract document, made from
word documents with information I would get from Excel.

I am not talking of the publipostage option as this
command should be done trhough the program I have created
from Excel in VBA.

For exemple : car rental contract
from the windows on screen, developped in VBA, I want to
print the data I have just input on a renting contract,
which is a word document.

Do you have any idea about it.

cheers

Eric

5 réponses

Avatar
Lydya
Hi Eric

This may give you an idea...

Sub WordFromExcel()
Dim AppWord As Object
Set AppWord = CreateObject("Word.Application")
With AppWord
.Visible = True
'creates a new Word document
.documents.Add
'opens an existing document (change path)
'.documents.Open FileName:="C:whatever.doc"
.activedocument.PrintOut
End With
End Sub

You need to add the Microsoft Word Object Library to your Excel VBE (Tools /
References...) to access the VBA Word help.

Lydya

-------------
"Eric" a écrit dans le message de
news:01f101c39339$fcd2d3c0$
hi everybody,

I am trying to fulfill some contract document, made from
word documents with information I would get from Excel.

I am not talking of the publipostage option as this
command should be done trhough the program I have created
from Excel in VBA.

For exemple : car rental contract
from the windows on screen, developped in VBA, I want to
print the data I have just input on a renting contract,
which is a word document.

Do you have any idea about it.

cheers

Eric


Avatar
Transport adapté Amos
You pourrais make the programme in Word et use le mail-merge.


"Eric" a écrit dans le message de
news:01f101c39339$fcd2d3c0$
hi everybody,

I am trying to fulfill some contract document, made from
word documents with information I would get from Excel.

I am not talking of the publipostage option as this
command should be done trhough the program I have created
from Excel in VBA.

For exemple : car rental contract
from the windows on screen, developped in VBA, I want to
print the data I have just input on a renting contract,
which is a word document.

Do you have any idea about it.

cheers

Eric


Avatar
Eric
What is exactly the mail merge???

-----Message d'origine-----
You pourrais make the programme in Word et use le mail-
merge.



"Eric" a écrit dans
le message de

news:01f101c39339$fcd2d3c0$
hi everybody,

I am trying to fulfill some contract document, made from
word documents with information I would get from Excel.

I am not talking of the publipostage option as this
command should be done trhough the program I have
created


from Excel in VBA.

For exemple : car rental contract
from the windows on screen, developped in VBA, I want to
print the data I have just input on a renting contract,
which is a word document.

Do you have any idea about it.

cheers

Eric



.




Avatar
Lydya
publipostage!!!

"Eric" a écrit dans le message de
news:2c72001c393ba$96184940$
What is exactly the mail merge???

-----Message d'origine-----
You pourrais make the programme in Word et use le mail-
merge.



"Eric" a écrit dans
le message de

news:01f101c39339$fcd2d3c0$
hi everybody,

I am trying to fulfill some contract document, made from
word documents with information I would get from Excel.

I am not talking of the publipostage option as this
command should be done trhough the program I have
created


from Excel in VBA.

For exemple : car rental contract
from the windows on screen, developped in VBA, I want to
print the data I have just input on a renting contract,
which is a word document.

Do you have any idea about it.

cheers

Eric



.




Avatar
Eric
Merci Lydya, I will have a go
-----Message d'origine-----
Hi Eric

This may give you an idea...

Sub WordFromExcel()
Dim AppWord As Object
Set AppWord = CreateObject("Word.Application")
With AppWord
.Visible = True
'creates a new Word document
.documents.Add
'opens an existing document (change path)
'.documents.Open FileName:="C:whatever.doc"
.activedocument.PrintOut
End With
End Sub

You need to add the Microsoft Word Object Library to your
Excel VBE (Tools /

References...) to access the VBA Word help.

Lydya

-------------
"Eric" a écrit dans
le message de

news:01f101c39339$fcd2d3c0$
hi everybody,

I am trying to fulfill some contract document, made from
word documents with information I would get from Excel.

I am not talking of the publipostage option as this
command should be done trhough the program I have
created


from Excel in VBA.

For exemple : car rental contract
from the windows on screen, developped in VBA, I want to
print the data I have just input on a renting contract,
which is a word document.

Do you have any idea about it.

cheers

Eric



.