剥离邮件正文时VBA Outlook错误

时间:2016-04-13 07:34:07

标签: excel vba excel-vba email outlook

我正在使用VBA脚本删除电子邮件的正文,我已经成功删除了90%的电子邮件,但是当我到达最后的“查询”部分时,我遇到了错误,我无法修复。这是电子邮件正文。

(Pdb) formset.deleted_forms
[<django.forms.widgets.ActivitiesForm object at 0x7f19f6435f50>]

问题出在邮政编码试图查询时。在我的代码中,它似乎找到了查询的位置,但没有将整数赋给变量。请看屏幕截图,看看我的意思。

finds correct positon

The variable is just staying at 0

这是邮政编码剥离代码:

Ref: 1993
Business Headline: bla bka
Name: A Name
Email: email@email.com
Tel: 0777777777

Address Line: 123
Address Line 2: someroad
Town: sometown
County: lancashire
Postcode: APOS TCDE

Enquiry:
Please send me more information about this business. Regards, Gary.

1 个答案:

答案 0 :(得分:0)

postcode = Trim$(Mid$(b4, 8 + Len("Enquiry:" & vbNewLine), Len(b4)))