Prev: add multiple custom properties with a userform
Next: Autonew creates a new document from template and a new blank docum
From: jay-rod on 9 Feb 2010 14:13 I have an online business that sells on Amazon.com and want to send an e-mail to all my customers to leave feedback. Each customer has a specific link for their order #. But when I try to import those links into the document from excel they are the full 50+ character link, I want to format them to say "this link". So far I've done the whole mailings>e-mail>recipients from excel document. And I can insert the column data with no problem, but when I tried edit it as a hyperlink it wouldn't let me as all the data will vary for each recipient. Thank you for your help in advance! -Jarred
From: Graham Mayor on 10 Feb 2010 06:53
Are your customers going to appreciate being harrassed in this way? You might lose more future business than you gain. A method to read an Excel range is covered at http://word.mvps.org/FAQs/InterDev/XLToWordWithDAO.htm It is not clear from your message what exactly it is you want to do, but to read a named range (a column of e-mail addresses named eMail) from an Excel sheet (D:\My Documents\Test\Name.xlsx) and write the content of each field in turn to a hyperlink to a new document, with the display text as "This Link", the following will work. All you need to do is adapt the while ....wend process to reflect your own conditions. Dim db As DAO.Database Dim rs As DAO.Recordset Dim oDoc As Document Set db = OpenDatabase("D:\My Documents\Test\Name.xlsx", False, False, "Excel 8.0") Set rs = db.OpenRecordset("SELECT * FROM eMail") While Not rs.EOF Set oDoc = Documents.Add oDoc.Range.Hyperlinks.Add oDoc.Range, _ Address:="MailTo: " & Trim(rs.Fields(0).Value), TextToDisplay:="This Link" rs.MoveNext Wend rs.Close db.Close Set rs = Nothing Set db = Nothing -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "jay-rod" <jayrod(a)discussions.microsoft.com> wrote in message news:89A7604B-62EB-4466-A706-252BC51A4BB4(a)microsoft.com... >I have an online business that sells on Amazon.com and want to send an > to all my customers to leave feedback. Each customer has a specific link > for > their order #. > > But when I try to import those links into the document from excel they are > the full 50+ character link, I want to format them to say "this link". > > So far I've done the whole mailings>e-mail>recipients from excel document. > And I can insert the column data with no problem, but when I tried edit it > as > a hyperlink it wouldn't let me as all the data will vary for each > recipient. > > Thank you for your help in advance! > > -Jarred |