FYI this thread is also open here:
http://www.outlookcode.com/messages.aspx?forumid=2

I am having trouble targeting the attachments.add position in my automated emails. My code will run from MS Word, and place attachments in variable parts of the email body.

This integer value will change for each email, and I need to devise a function to return this integer value based on the number of characters between two pieces of text in the body of my email.

I use a MS Word function (Thanks to Frosty) that returns a range of text , but it is based on the find method and assigning found text to a range variable. Then I use the len function to evaluate the range like this Len(rngTest).

I have tried to adapt this function to outlook , but the find function works differently and there is no range variable to my knowledge. Also, the integer returned in Word does not match up to the number of characters in my email message.

I am sure I could put something together using Len, if I could define the string/range variable via a function.

Does anyone have ideas on a function to define a range of text in the email body from say, "Hello" to "InsertDoc"? I have tried things like Len("Hello * InsertDoc"), but because this is a string it just evaluates the exact text in the function.