
Generating a word document from Excel
Hi Michelle,
the following code may be useful for you. The sub first opens word, then add a new document, set format of text and finally insert in document the content of cell A1 of the active excel worksheet.
All code lines that begin with "wd" use word VBA commands.
Sub WordDoc()
Dim wd As Object
Set wd = CreateObject("Word.Application")
wd.Visible = True
wd.Documents.Add
wd.Selection.Font.Bold = True
wd.Selection.Font.Italic = True
wd.Selection.Font.Size = 14
wd.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
wd.Selection.TypeText Text:=Range("A1").Text
End Sub
Hope this helps.
Sergio
--
Please post any follow question in the newsgroup.
Remove 'NOSPAM' to reply by e-mail.
Quote:
> I have a currency value in a cell in an Excel worksheet.
> I need a macro to generate a word document which will then insert this value
> in a particular place within a standard text.
> Any ideas?
> Many thanks
> paddymichelle