Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default 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
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
transfer info from Excel to Hotmail Contacts mcn7 Excel Discussion (Misc queries) 0 April 24th 06 07:17 AM
How to transfer info from PDF file to excel (lists)???????? [email protected] Excel Worksheet Functions 2 August 23rd 05 09:53 PM
How do i transfer spreedsheet info in excel to MS Word make label water New Users to Excel 1 June 24th 05 08:37 PM
How do i transfer spreedsheet info in excel to MS Word make label water New Users to Excel 2 June 24th 05 12:03 AM
how to make the links info dialog box not appear mango Excel Worksheet Functions 1 December 3rd 04 06:24 AM


All times are GMT +1. The time now is 07:03 AM.

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

About Us

"It's about Microsoft Excel"