View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
learningaccess learningaccess is offline
external usenet poster
 
Posts: 37
Default Running Macro in Excel to mailmerge and print in background

OK. I see how that would work. How do i get my current Excel macro to call up
and run that code? (I am VERY new to VB and have just recently started
learning the code)

Thanks for your response.

"Tom Ogilvy" wrote:

http://support.microsoft.com/?id=177760
VBA: How to Run Macros in Other Office Programs (OFF 97)

The following Sub procedure assumes that the document WordDoc.Doc contains a
macro called "WordMacro."
has this example:
Sub WDTest()
Dim WD as Object
Set WD = CreateObject("Word.Application")
WD.Documents.Open "C:\My Documents\WordDoc.Doc"
' Note that the project name and module name are required to
' path the macro correctly.
WD.Run "Project.Module1.WordMacro"
End Sub

To the best of my knowledge, you would need your concatenated values on a
separate sheet by themselve with a header row. Probably better to have that
as the first sheet in the workbook.


http://support.microsoft.com/default...b;en-us;318117
HOW TO: Use Addresses from an Excel 2002 Worksheet to Create Labels in Word
2002

--
Regards,
Tom Ogilvy



"learningaccess" wrote:

I have a spreadsheet with multiple columns of data that are being
concatenated into one column. I am trying to mailmerge that one column into
Word so that i can print the data onto some avery labels.

I actually have a couple of questions concerning this:

1) As of now, i have the "main" spreadsheet feeding a separate sheet because
i could not figure out how to have word only merge the one column with the
conatenated data. Can someone help me figure out how to merge only the
concatenated data?

2) I have a macro set to auto_open that prompts the user for specified
information. I would like to allow the user to click a button and have Excel
open word and run the macro i have recorded in Word. I have seen a few topics
on this subject, but none that really seemed to help me.

I have the code for both macros (in Word and Excel) if that would help at all.

Thanks in advance.