In Outlook 2010 I have thousand email products updates for multiple customers with URL in message body like that:
http://shop.khlynov.net/products/en/PRODUCT_ID_VARIABLE/enter.asp?z=UNIQUE_ACCESS_KEY
something like that:
where:
- all before
VOP08011316314153US
- constant part of URL VOP08011316314153US/
- product ID variable (there are thousands)enter.asp?z=AFE38DC1F69084D0B95648B21B8F1DC65E2D7E9A11A710590C60AA49390E2DC928
- access key unique for each customer (I don't use it)
I want that a script:
- search for
PRODUCT_ID_VARIABLE
in all messages in Outlook Inbox folder - create subfolders named according to the
PRODUCT_ID_VARIABLE
(if it doesn't exist) - move messages with different PRODUCT_ID_VARIABLE into corresponding subfolders.
In the example below a script should create folders VOP08011316314153US
and VOP08011316314154US
(if they don't already exist) and move there all messages with product IDs VOP08011316314153US
and VOP08011316314154US
in URLs:
Here's an example of how the email body may look like:
<table align="left">
<tr>
<td style="padding: 9px;" align="left">
<p style="font-size: 10px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
color: #333333;">
<span style="color: #9B0124;">PRODUCT LINK: </span><br />
<a href="http://shop.khlynov.net/products/en/VOP23011304005259US/enter.asp?z=ABCC226C7CBA08F2D0CE2BAB7CBFE493E04D9533489C3FF245EB4061D0FA6A7D18" target="_blank" style="text-decoration: none; color: #333333;">http:/<wbr>/<wbr>shop.khlynov.net/<wbr>products/<wbr>en/<wbr>VOP23011304005259US/<wbr>enter.asp?z=ABCC226C7CBA08F2D0CE2BAB7CBFE493E04D9533489C3FF245EB4061D0FA6A7D18</a>
</p>
</td>
</tr>
</table>
INBOX
-VOP08011316314153US
-- Email 1
-- Email 2
-- Email ...
-- Email X
-VOP08011316314154US
-- Email 1
-- Email 2
-- Email ...
-- Email X
I am very new in VBA coding. Could anyone help to write a code from a scratch?
I've just found that your macro work well with plain text but doesn't work with HTML letters. Here's the part of HTML code:
<table align="left">
<tr>
<td style="padding: 9px;" align="left">
<p style="font-size: 10px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
color: #333333;">
<span style="color: #9B0124;">PRODUCT LINK: </span>
<br />
<a href="http://shop.khlynov.net/products/en/VOP23011304005259US/enter.asp?z=ABCC226C7CBA08F2D0CE2BAB7CBFE493E04D9533489C3FF245EB4061D0FA6A7D18" target="_blank" style="text-decoration: none; color: #333333;">http:/<wbr>/<wbr>shop.khlynov.net/<wbr>products/<wbr>en/<wbr>VOP23011304005259US/<wbr>enter.asp?z=ABCC226C7CBA08F2D0CE2BAB7CBFE493E04D9533489C3FF245EB4061D0FA6A7D18</a>
</p>
</td>
</tr>
</table>