PDA

View Full Version : Excel Mail Merge



underscorede
04-24-2012, 08:58 PM
Hello,

I know mail merge is easy to use and speaks for itself, but we are encountering a problem with a bottleneck with having to insert a company logo on each individual name tag we create.

We are creating a name tags based on a list of names using mail merge. After the name tags are created we have to individually add the company logo to each persons name tag.

The issue is this:
The company logo is always different depending on the day of the week. Ie: For Monday the name tags all have "company A's logo" on Tuesday all the name tags have "company B's logo"

Is there way i can add some VBA to my spreadsheet so that when I open "names.xls" a dialogue box appears and asks me to insert first name, then last name, then gives me the option to select a company logo from my desktop using a "browse" button.

Has anyone ever done this before? Or does anyone have any recommendations on an easier way to automatically change a company's logo from day to day without having to change each individual name tag.

underscorede
04-25-2012, 09:58 AM
Hello,

Okay Ive managed to create the file i need.

I attached my document....What im trying to do is when the dialogue box appears and a person clicks "browse" and selects a .jpg image I want the path to the image to display in the text box above the "browse" button.

For some reason the path isn't showing...Any idea's why??

Thanks!!

tpoynton
04-25-2012, 05:55 PM
try adding TextBox1.Text = vaFiles right before the end sub of the commandbutton1_click sub in the userform code. if I read it right, you have the textbox populated in a textbox_change event, but it does not ever change. I'd also set multiselect=false.

In terms of an easier way to do it...not sure! but this should get your textbox populated after browsing for the file.

snb
04-26-2012, 01:55 AM
Assume:

- logos in directory "G:\OF\"
- logo for monday : 'logo1'; tuseday 'logo2'

Then this macro suffices (no userform needed)

Sub snb()
x3 = "G:\OF\logo" & Weekday(Date, 2) & ".jpg"
end sub