[英]open outlook mail in customized form
I have created a small application in Excel-VBA which takes inputs from a user and the application sends and email to me the inputs in an encrypted form.我在 Excel-VBA 中创建了一个小应用程序,它从用户那里获取输入,应用程序将输入以加密形式发送并通过电子邮件发送给我。
Now, I have a macro in outlook-vba which takes care of decryption and saves data in required format, so that's not a problem.现在,我在 Outlook-vba 中有一个宏,它负责解密并以所需格式保存数据,所以这不是问题。 What I need is I want to open that specific mail from the user in a customized format so that without running that script I could see the data.我需要的是我想以自定义格式打开来自用户的特定邮件,以便在不运行该脚本的情况下我可以看到数据。 Eg The data comes in like this例如数据是这样进来的
1~Saurav Gupta~100^2~Sachin Rana~200^
Now I want it to be shown as in a tabular format in a form, say现在我希望它以表格格式显示,例如
S.No Name Marks
1 Saurav Gupta 100
2 Sachin Rana 200
Any idea how can I achieve that?知道我怎么能做到这一点吗?
Thanks and regards Saurav.感谢并问候 Saurav。
Use the builtin Split
function to separate the lines and the fields in the data:使用内置的Split
函数来分隔数据中的行和字段:
Option Explicit
Sub SplitTest()
Dim sInput As String
Dim sLines() As String
Dim sFields() As String
Dim iLine As Integer
sInput = "1~Saurav Gupta~100^2~Sachin Rana~200^"
'***** Split sInput into lines
sLines = Split(sInput, "^")
'***** Do something with the lines
For iLine = 0 To UBound(sLines) - 1
Debug.Print sLines(iLine)
'***** Split each line into fields
sFields = Split(sLines(iLine), "~")
'***** Do something with the fields
Debug.Print "#1. " & sFields(0) & ", #2. " & sFields(1) & ", #3. " & sFields(2)
Next iLine
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.