Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to transfer info from Excel to Words envelope Dialog box.
I have a form letter that I send out regularly. I put the form letter in
Excel to manipulate the Numbers (in cells)and margins better. My problem is I also print envelopes to go with these letters, but I can only copy and paste from Excel to the Word envelope dialog box. I would like to be able to click a button and the Word dialog box comes up with the address in it. Thanks for any help you can provide. Eddie Washington |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to transfer info from Excel to Words envelope Dialog box.
Eddie
This is probably the worst Word programming ever, but it works. Set a reference (VBE - Tools - References) to the Microsoft Word x.x Object Library and run this macro. It assumes that your address is in A1:A3. Sub MakeEnvelope() Dim wdApp As Word.Application Dim wdDoc As Word.Document Set wdApp = New Word.Application Set wdDoc = wdApp.Documents.Add wdApp.Visible = True wdApp.Selection.Text = Range("A1").Text wdDoc.Paragraphs.Add wdDoc.Range(wdDoc.Characters.Count - 1, wdDoc.Characters.Count).Select wdApp.Selection.Text = Range("a2").Text wdDoc.Paragraphs.Add wdDoc.Range(wdDoc.Characters.Count - 1, wdDoc.Characters.Count).Select wdApp.Selection.Text = Range("a3").Text wdDoc.Range(0, wdDoc.Characters.Count).Select wdApp.CommandBars.FindControl(, 794).Execute End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "EWASHI5279" wrote in message ... I have a form letter that I send out regularly. I put the form letter in Excel to manipulate the Numbers (in cells)and margins better. My problem is I also print envelopes to go with these letters, but I can only copy and paste from Excel to the Word envelope dialog box. I would like to be able to click a button and the Word dialog box comes up with the address in it. Thanks for any help you can provide. Eddie Washington |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
transfer info from Excel to Hotmail Contacts | Excel Discussion (Misc queries) | |||
How to transfer info from PDF file to excel (lists)???????? | Excel Worksheet Functions | |||
How do i transfer spreedsheet info in excel to MS Word make label | New Users to Excel | |||
How do i transfer spreedsheet info in excel to MS Word make label | New Users to Excel | |||
how to make the links info dialog box not appear | Excel Worksheet Functions |