用WINRAR压缩10MB部分文件。我想循环并创建一个附加每个部分的电子邮件,并在发送之前显示所有电子邮件。
Set OutApp = CreateObject("Outlook.Application")
Application.Wait (Now + TimeValue("0:00:30"))
On Error GoTo 0
Set OutMail = OutApp.CreateItem(0)
For i = 1 To times
With OutMail
.To = wb1.Sheets("MAIL").Cells(4, 3).Value
.CC = wb1.Sheets("MAIL").Cells(5, 3).Value
.BCC = ""
.Subject = wb1.Sheets("MAIL").Cells(6, 3).Value
.Body = wb1.Sheets("MAIL").Cells(9, 3).Value
'You can add other files also like this
If (times > 1) Then
.Attachments.Add source & "part" & i & ".rar"
Else: .Attachments.Add source & "rar"
End If
'.Send 'or use .Display
.Display
End With
Next i
我要么:
我希望我自己解释一下。
答案 0 :(得分:1)
您只是错过了创建新邮件的部分
Scanning dependencies of target unitconverter
[ 95%] Building CXX object H08-unit-converter/CMakeFiles/unitconverter.dir/src/unitconverter.cxx.o
/unitconverter.cxx: In instantiation of ‘static const M1 Measure_add<M1, M2>::value() [with M1 = Measure<10, (Unit)2>; M2 = Measure<10, (Unit)2>]’:
/unitconverter.cxx:112:62: required from here
/unitconverter.cxx:78:63: error: could not convert ‘Measure<20, (Unit)2>()’ from ‘Measure<20, (Unit)2>’ to ‘const Measure<10, (Unit)2>’
return Measure<(M1::value + M2::value), M1::unit>();
^
/unitconverter.cxx:84:78: error: the value of ‘difference’ is not usable in a constant expression
return Measure<(M1::value + (M2::value * difference)), M1::unit>();
^
/unitconverter.cxx:82:19: note: ‘difference’ was not initialized with a constant expression
int const difference = Measure_difference<M1,M2>::value();
^
/unitconverter.cxx:84:78: note: in template argument for type ‘int’
return Measure<(M1::value + (M2::value * difference)), M1::unit>();
^
/unitconverter.cxx:87:78: error: the value of ‘difference’ is not usable in a constant expression
return Measure<(M2::value + (M1::value * difference)), M2::unit>();
^
/unitconverter.cxx:82:19: note: ‘difference’ was not initialized with a constant expression
int const difference = Measure_difference<M1,M2>::value();
^
/unitconverter.cxx:87:78: note: in template argument for type ‘int’
return Measure<(M2::value + (M1::value * difference)), M2::unit>();
^
循环内的 ,如下所示:
Set OutMail = OutApp.CreateItem(0)