LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Controlling Word from Excel

I am trying to create a word document from data in an Excel form.
have managed to set up the references and can get Excel to copy on
piece of data over to Word and format it, but my problem arises whe
trying to copy a second piece of data. When I try copying a secon
piece of data it overwrites the first piece of data. How can I ge
multiple bits of data into Word and format them in different ways, i
different font sizes?

This is the code I have tried to use:-

Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim mywdRange As Word.Range

Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Open("C:\template2.doc")
Set mywdRange = wrdDoc.Words(1)

With mywdRange
.Text = "Test1"
.Font.Size = "10"
.Bold = True
.Text = "Test2"
.Font.Size = "20"
.Bold = False
End With


Any help would be most gratefully received

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling word wrap in a cell Victor Delta[_2_] Excel Discussion (Misc queries) 2 February 14th 10 10:58 PM
Controlling Word template from Excel Lee Excel Programming 1 November 9th 03 11:50 AM
controlling cell borders in excel using VB eli silverman Excel Programming 2 September 27th 03 04:23 PM
Controlling Outlook from Excel Using VBA Trevor Shuttleworth Excel Programming 1 September 9th 03 10:43 PM
controlling another program from Excel Steve Smallman Excel Programming 1 August 1st 03 03:01 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"