ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   inputting text on Word document using excel (https://www.excelbanter.com/excel-programming/331023-inputting-text-word-document-using-excel.html)

[email protected]

inputting text on Word document using excel
 
hi
i wish to use Excel VBA to include/insert text from some data into Word
document.
the word document has the following simple format

Name: Number Login Id
--------------------------------------------
<name <number <id

<name, <number, and <id are to be inserted under then line
"-------".
If there are multiple <names, <number and <id, it will be inserted
under each other..
Name: Number Login Id
--------------------------------------------
<name <number <id
<name <number <id
<name <number <id
.....

Is there some good guides or tutorials that can show me how to do this?
thanks.


Tom Ogilvy

inputting text on Word document using excel
 
Turn on the macro recorder in both Excel and Word. then perform the action
manually. Turn off the macro recorder in each. No combine the code. You
will need to add code to get an instance of Word from excel using getobject
(assumes word is open) or createobject. If you are using late binding, then
you will need to replace any constants recorded with the actual value they
represent.

Good source to start learning about automation:
http://support.microsoft.com/?id=167223
Microsoft Office 97 Automation Help File Available on MSL


http://support.microsoft.com/?id=165518
Calling Macros Using OLE from MS Visual Basic for Applicatons
(this has word running an excel macro, but the idea should the same)

http://support.microsoft.com/?id=149830
XL: Macro to Link a Range of Cells in Word
(Example of Excel controlling word)


http://support.microsoft.com/?id=165926
OFF97: Can't Dimension Word as Application from Other Program
(Examples of Working with Word 97 using OLE)

http://support.microsoft.com/?id=135082
Invalid Page Fault Running VB Macro in Hidden Word Session
(Word 7, when Word is Closed causes a problem)



--
Regards,
Tom Ogilvy

wrote in message
oups.com...
hi
i wish to use Excel VBA to include/insert text from some data into Word
document.
the word document has the following simple format

Name: Number Login Id
--------------------------------------------
<name <number <id

<name, <number, and <id are to be inserted under then line
"-------".
If there are multiple <names, <number and <id, it will be inserted
under each other..
Name: Number Login Id
--------------------------------------------
<name <number <id
<name <number <id
<name <number <id
....

Is there some good guides or tutorials that can show me how to do this?
thanks.





All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com