如何从 Outlook 表单中删除旧签名?

发布于 2024-07-19 08:51:39 字数 734 浏览 11 评论 0原文

我修改了现有表单并将其作为 .oft 文件保存在桌面上。 每当我发送此表格时,我都会显示一个旧签名。

如果我双击 .oft 文件,我会看到带有旧签名的正文,然后在其下面看到我的新签名。 我想删除粘在身体上的旧签名。 让我感到困惑的是,当我在 Outlook 表单中打开该文件时,它从不包含消息中的签名,这就是为什么当我运行表单时,除了发送它之外,我看不到此签名,而当我打开时,我会在预览中看到它我看到我的 Outlook 表单应该是这样的消息。


我设法将文件另存为 html。 我看到页面底部有签名。

如何删除或修改 html 文件以删除该签名并取回原始 oft 文件。

我还尝试保存为 html,删除签名,保存,然后使用宏加载 html。 但无法保存回常。

Sub MakeHTMLMsg()
Set objMsg =3D Application.CreateItem(olMailItem)
Set fso =3D CreateObject("Scripting.FileSystemObject")
Set ts =3D fso.OpenTextFile("c:\testfile.htm", 1)=20
strText =3D ts.ReadAll
objMsg.HTMLBody =3D strText
objMsg.Display
Set fso =3D Nothing
Set ts =3D Nothing=20
Set objMsg =3D Nothing
End Sub

I modified an existing form and saved it on my desktop as .oft file.
Whenever I send this form I have an old signature that shows.

If I double click the .oft file I see the body with that old signature and then my newer one below it. I would like to delete that old signature that is stuck in the body. What confuses me is that when I open that file in Outlook forms it never includes a signature in messages, which is why when I run the form I don't see this signature except when I send it, I see it in preview when I open the message I see my Outlook form as it should be.


I managed to save the file as html. I see the signature on the bottom of the page.

How can I remove or modify the html file to remove that signature and get back the original oft file.

I also tried saving as html, removing the signature, saving, then using a macro to load the html. But unable to save back to oft.

Sub MakeHTMLMsg()
Set objMsg =3D Application.CreateItem(olMailItem)
Set fso =3D CreateObject("Scripting.FileSystemObject")
Set ts =3D fso.OpenTextFile("c:\testfile.htm", 1)=20
strText =3D ts.ReadAll
objMsg.HTMLBody =3D strText
objMsg.Display
Set fso =3D Nothing
Set ts =3D Nothing=20
Set objMsg =3D Nothing
End Sub

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清音悠歌 2024-07-26 08:51:40

如果您或协作者不小心在邮件正文(包括签名)中保存了带有 RTF 的 .oft Outlook 表单,据我所知,该富文本将永远卡在 .oft 中(除非您决定将其破解)在十六进制编辑器中)。 正如其他人在网络的黑暗角落所建议的那样,您可以运行表单,删除邮件正文,并将其另存为 .oft - 但不幸的是,这不适用于 RTF。 RTF 卡住了。 我发现隐藏此文本的唯一方法是使用此 VBScript Outlook 宏将 MailItem 的 BodyFormat 类型更改为纯文本。 RTF 字节将保留在您的 .oft 中,但至少没有人会查看它们。

Sub ChangeToPlainTextAndPublishForm()
    Dim objOL       ' As Outlook.Application
    Dim objItem     ' As Outlook.ContactItem
    Dim objFD       ' As Outlook.FormDescription
    Const olPersonalRegistry = 2
    Const olDiscard = 1

    Set objOL = CreateObject("Outlook.Application")
    Set objItem = objOL.CreateItemFromTemplate("C:\MyPath\MyForm.oft")
    Set objFD = objItem.FormDescription

    objItem.BodyFormat = OlBodyFormat.olFormatPlain

    'Publish to personal forms library
    With objFD
        .DisplayName = "myForm"
        .PublishForm olPersonalRegistry
    End With
    objItem.Close olDiscard

    Set objFD = Nothing
    Set objItem = Nothing
    Set objOL = Nothing
End Sub

If you or a collaborator accidentally saves an .oft Outlook Form with RTF in the message body (which includes signatures), this rich text will be forever stuck in the .oft, as far as I can tell (unless you decide to hack it up in a hex editor). As others suggest in the dark corners of the web, you can run the form, delete the message body, and save it as an .oft - but unfortunately, this does not work with RTF. The RTF is stuck. The only way I have found to hide this text is with this VBScript Outlook macro to change the MailItem's BodyFormat type to plain text. The RTF bytes will remain in your .oft, but at least no one will be looking at them.

Sub ChangeToPlainTextAndPublishForm()
    Dim objOL       ' As Outlook.Application
    Dim objItem     ' As Outlook.ContactItem
    Dim objFD       ' As Outlook.FormDescription
    Const olPersonalRegistry = 2
    Const olDiscard = 1

    Set objOL = CreateObject("Outlook.Application")
    Set objItem = objOL.CreateItemFromTemplate("C:\MyPath\MyForm.oft")
    Set objFD = objItem.FormDescription

    objItem.BodyFormat = OlBodyFormat.olFormatPlain

    'Publish to personal forms library
    With objFD
        .DisplayName = "myForm"
        .PublishForm olPersonalRegistry
    End With
    objItem.Close olDiscard

    Set objFD = Nothing
    Set objItem = Nothing
    Set objOL = Nothing
End Sub
世俗缘 2024-07-26 08:51:40

知道了,
添加消息框。 然后去运行这个表格。 瞧。
删除不需要的签名。
另存为

谢谢

got it,
add message box. then go to run this form. and voila.
remove the unwanted signature.
save as

thank you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文