How to Iterate through the contents of the Get OutLook MailMessage to a String collection

studio

#1

I need to read the mail, then determine the content of the message, and type the contents of the message into the specified location in the word document.

How to Iterate through the contents of the Get OutLook MailMessage to a String collection.


#2

Please help me


#3

Hi Money,

Here are the steps to iterate through the Mail Messages and access the content of each.
1.) Use Get Outlook MailMessages to get an array of Mail Message items.
2.) Use a For Each to iterate through the collection ( be sure to change the data type to MailMessage)
3.) In the sequence of that For Each loop, access the body by typing ‘Mail.Body.ToString’. Be sure to test this by dragging a message box in the loop and printing this value.

Best,
Matt


#4

thank you ver much


#5

How to write irregular data into a word document?


#6

What type of data are you trying to write? What error are you getting?


#7

Document.Range(Start:=document.tables(1).cell(6,1).rang,End:=doucument.tables(1).cell(12,4))

Unable to assign range( Micrsoft.office.interop.word.range)

error (Type mismatch)


#8

I would recommend iterating through the rows of the data table and first trying to print the contents with a message box. Use ‘for each row’ and then inside the sequence use a message box that prints ‘row(0).ToString’. If you get data, then find the index/column name of the column you want in that row and then input that data into word.


#9

Thank you very much. I’ve solved it.