#1
|
|||
|
|||
series letter makro 'selecting recievers'
Hello,
i want to finish my little project which creates letters with different texts for every adress listed in the linked excel file. Now I want a dialog to give the users the ability to select the lines(addresses) themselves from the linked excel file. How can I realize this dialog, familiar to the dialog to select the recievers in standard series letters. This is my code in a simplified version, because not every function is asked here. Rhe program works perfectly fine, I just need help with the selecting thing. '### open excel file ### Dim objXlsAppl As Object 'Excel.Application Dim objXlsWbk As Object 'Excel.Workbook Dim objXlsWks As Object 'Excel.Worksheet Const pfad As String = genpath & "datensaetze.xlsm" 'Path of the xlsm Set objXlsAppl = CreateObject("excel.application") Set objXlsWbk = objXlsAppl.Workbooks.Open(Filename:=pfad) objXlsAppl.Visible = False Set objXlsWks = objXlsWbk.Worksheets("Datensätze") '### open dialog ### 'empty, help needed '### select lines ### 'empty, help needed '### for selected lines create letter ### Dim Counter For Counter = 2 To objXlsWks.UsedRange.Rows.Count 'erste bis letzte Zeile If haken = True Then 'do letters Else 'do nothing End If Next Counter End Sub Thank you for your help |
#2
|
||||
|
||||
The Mail Merge functionality provides a dialog to allow you to select data rows. Is there a reason you aren't using this?
Doing it with VBA is way harder and would probably require two separate macros to:
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
||||
|
||||
You should be using mailmerge for this instead of VBA. Mailmerge allows you to select which records to process.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
dialog, letter, select |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Use L and R arrow to move cursor letter to letter, not top of the line | mellowkitten | Word | 2 | 05-12-2016 07:23 PM |
How to replace a letter to random letter with different color? | cikanoz87 | Word | 7 | 06-18-2015 09:43 PM |
VBA-Code/Makro for word file to XML | Tommes93 | Word VBA | 2 | 03-31-2014 12:34 AM |
Create makro that counts the number of checked tick boxes in a survey | johannapaj | Word VBA | 0 | 09-05-2011 01:51 AM |
Selecting specific text out of a series of columns | speedycorn1 | Word | 3 | 11-01-2010 02:58 PM |