将 Word 模板从 MS Word 2003 转换为 MS Word 2007

发布于 2024-07-21 07:22:05 字数 765 浏览 1 评论 0原文

我在将 Word 模板从 Word 2003 移动到 Word 2007 时遇到问题

我需要转换的代码是

Sub Standardbrev()

    Documents.Add Template:= _
        "p:\setup\stdbrev.DOT", NewTemplate:= _
        False

    mask "<Navn>", False
    mask "<Adresse>", False
    mask "<Postby>", False
    mask "<att>", True
    mask "<Jura Nr>", False
    mask "<Vedr>", False
    mask "<Jurist>", False
End Sub

编辑,问题: 当我尝试将代码复制/粘贴到 dotx 文档时,出现编译错误:

未定义子或函数。

如果我注释了 maskpart,我可以运行宏,它会在新窗口中打开 stdbrev.DOT 文件

编辑:它在 2003 年做了什么: 当您运行宏时,会弹出 7 个框(每个掩码 1 个),您可以在其中填写信息。 该信息替换了文档中的掩码字段

希望这可以解释我的问题

编辑:我找到了解决方案,我误解了一些代码并且不知道掩码是很久以前由其他人编写的函数。 很抱歉发布这个菜鸟问题

I have a problem moving a Word template from Word 2003 to Word 2007

The code which I need to convert is

Sub Standardbrev()

    Documents.Add Template:= _
        "p:\setup\stdbrev.DOT", NewTemplate:= _
        False

    mask "<Navn>", False
    mask "<Adresse>", False
    mask "<Postby>", False
    mask "<att>", True
    mask "<Jura Nr>", False
    mask "<Vedr>", False
    mask "<Jurist>", False
End Sub

Edit, problems:
When I try to copy/paste the code to a dotx document I get a compile error saying:

Sub or Function not defined.

If I outcomment the maskpart I can run the macro and it opens the stdbrev.DOT file in a new window

Edit: What it do in 2003:
When you run the macro a 7 boxes (1 for each mask) pop up where you can fill info into them. The info the replaces the mask fields in the document

Hope this explains my problem

Edit: I found the solution, I misunderstood some of the code and did not know that mask was a function written by someone else a long time ago. Sorry for posting this noobish question

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

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

发布评论

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

评论(1

猫瑾少女 2024-07-28 07:22:05

mask 不是内置函数。 此函数应在模块中的某个位置定义,并且您还必须将此函数复制到 Word 2007 文档(这就是您收到错误“Sub 或 Function not Defined”的原因。)。 您可以通过右键单击mask然后选择定义来查看此函数的定义位置。

然而,“迁移”的最简单方法是在 Office 2007 中打开 Word 2003 文档,然后将其另存为 .dotm 或 .docm 文件(取决于您要创建模板还是常规文档)。

mask is not a built-in function. This function should be defined somewhere in a module and you also have to copy this function to the Word 2007 document (That is why you get the error "Sub or Function not defined."). You can see where this function is defined by right-clicking on mask and then selecting Definition.

However, the easiest way to "migrate" this would be to simply open your Word 2003 document in Office 2007 and then save it as either .dotm or .docm file (depending whether you want to create a template or a regular document).

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