首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Word宏状态栏消息消失

Word宏状态栏消息消失
EN

Stack Overflow用户
提问于 2019-12-05 11:48:49
回答 1查看 270关注 0票数 0

我有个脚本可以随机发送邮件。现在,我希望它在状态栏中显示当前状态,例如“发送的73封邮件中的3封”。

  1. I设法将其输出到当前数字,如何输出总数?状态栏状态栏
  2. 不再显示我的信息,一旦我单击Word,它就消失了,不会出现。然后,它只显示当前的单词号.

代码语言:javascript
复制
' Merges one record at a time to email with a pre-defined delay between messages.
' Sourced from: https://www.msofficeforums.com/mail-merge/38282-email-merge-delay.html
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
Dim i As Long
With ActiveDocument
  For i = 1 To .MailMerge.DataSource.RecordCount
  aktuell = i
    With .MailMerge
      .Destination = wdSendToEmail
      .MailSubject = "TECOSIM wünscht frohe Weihnachten!"
      .MailFormat = wdMailFormatHTML
      .MailAddressFieldName = "EMAIL"
      .SuppressBlankLines = True
            With .DataSource
        .FirstRecord = i
        .LastRecord = i
        .ActiveRecord = i
      End With
      .Execute Pause:=False
        End With
        Dim PauseDelay As Long
    PauseDelay = Int((480 - 300 + 1) * Rnd + 300) '
    Application.StatusBar = "Der Versand wird aktuell durchgeführt..." & aktuell & " gesendet."
    Call Pause(PauseDelay) ' Calls Pause with the random interval
  Next i
End With
Application.ScreenUpdating = True
End Sub


Public Function Pause(Delay As Long)
Dim Start As Long
Start = Timer
If Start + Delay > 86399 Then
  Start = 0: Delay = (Start + Delay) Mod 86400
  Do While Timer > 1
    DoEvents ' Yield to other processes.
  Loop
End If
Do While Timer < Start + Delay
  DoEvents ' Yield to other processes.
Loop
End Function


I hope you can help me.
EN

回答 1

Stack Overflow用户

发布于 2019-12-06 00:49:43

尝试:

代码语言:javascript
复制
Dim i As Long, j As Long
With ActiveDocument
  j = .MailMerge.DataSource.RecordCount
  For i = 1 To j
    ...
    Application.StatusBar = "Senden läuft ... " & i & " von " & j & " gesendet."
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59194480

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档