无法在Word for Mac中创建宏 [英] Can't Create Macros any more in Word for Mac

查看:467
本文介绍了无法在Word for Mac中创建宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


今天我的钥匙串文件损坏了,或类似的东西,Apple支持尝试了多种方法,但最终我们将Apple Keychain的文件夹注入了垃圾修复了所有iCloud / email / iMessage问题。但是,它在Word for Mac中产生了
的问题。我的自定义宏消失了。我尝试制作新的,但每次都有错误代码5941运行时错误。过去5个小时我尝试了很多东西。我甚至卸载并重新安装了Office 365,看看是否可以修复它。到目前为止,我没有找到
修复。我是一名作家(不是程序员)。我通常会创建简单的宏来修改字体。字体颜色和大小。然后我将宏分配给自定义击键并且已经这样做多年了,已经在许多计算机上完成了,直到今天才被挫败了我的b $ b。下面是我制作一个简单的宏来将字体颜色从黑色更改为蓝色的步骤。对不起,如果这是你的下方。我还将粘贴代码的屏幕截图。 


我点击开发人员标签,选择记录宏,名称宏"Bluefont"并选择好。 


转到最顶部的"格式"下拉并选择字体,然后选择字体颜色为蓝色,然后好,然后停止录制宏。


这在过去一直有效。正如我们所说,它正在我的MacBook和我妻子的iMac上工作。但由于某种原因,我得到5941错误。我认为重新安装Word会解决它,但事实并非如此。我对编程一无所知,
但是我可以阅读并复制和粘贴:^)我复制并粘贴了当我选择"debug"时所看到的内容。获取错误代码后。谢谢你能给我的任何帮助。我想为不同的颜色制作这样的其他几个宏,还有两个
用于将字体更改为15pt,并将字体更改为12pt。 


Sub Bluefont()

'

'Bluefont Macro

'

'¥b $ b   使用ActiveDocument.Styles(-1031106208).Table.Condition(wdFirstRow).Font

        .Name =" Arial"

        .Size = 15

        .Bold = False

        .Italic = False

        .Underline = wdUnderlineNone

        .UnderlineColor = wdColorAutomatic

        .StrikeThrough = False

        .DoubleStrikeThrough = False

        .Outline = False

        .Emboss = False

        .Shadow = False

        .Hidden = False

        .SmallCaps = False

        .AllCaps = False

        .Color = 16724484

        .Engrave = False

        .Superscript = False

        .Subscript = False

        .Spacing = 0

        .Scaling = 100

        .Position = 0

        .Kerning = 0

        .Animation = wdAnimationNone

   结束时







解决方案

您好


样式对象(Word)


问候


Deepak




Hi,

Today I had my Keychain file corrupted, or something like that, and the Apple Support tried multiple things, but eventually we drug the Apple Keychain's folder into the trash which fixed all the iCloud/email/iMessage problems. However, it created problems in Word for Mac. My custom macros went away. I tried making new ones, but every time got a Error Code 5941 run time error. I tried many things for the last 5 hours. I even uninstalled and reinstalled Office 365 to see if that might fix it. So far, I haven't found a fix. I am a writer (not a programmer). I usually create simple macros to modify font. Font color and size. I then assign the macros to custom keystrokes and have been doing this for years, have done it on many computers, and not until today have I been thwarted. Here is the steps I go through to make a simple macro to change the font color from black to blue. Sorry if this is beneath you. I will also paste in a screenshot of the code. 

I click on the developer tab, select record macro, name macro "Bluefont" and select okay. 

Go to the very top "format" pull down and select font, then select font color blue, then okay, then stop recording macro.

This has always worked in the past. It is working on my MacBook and my wife's iMac right now as we speak. But for some reason I am getting the 5941 error. I thought reinstalling Word would fix it, but it has not. I don't know anything about programming, but I can read and copy and paste :^) I have copied and pasted what I see when I select "debug" after getting the error code. Thank you for any help you can give me. I want to make several other macros like this for different colors and also two for changing the font to 15pt, and changing the font to 12pt. 

Sub Bluefont()
'
' Bluefont Macro
'
'
    With ActiveDocument.Styles(-1031106208).Table.Condition(wdFirstRow).Font
        .Name = "Arial"
        .Size = 15
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = 16724484
        .Engrave = False
        .Superscript = False
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 0
        .Kerning = 0
        .Animation = wdAnimationNone
    End With



解决方案

Hi Jack Dagger,

let me first inform you that we are not available with MAC to test this code.

if i run the code as it is on Windows then i can reproduce the same error on my side.

i find that that the parameter value for styles is not correct in line below.

i try to replace that value with the value in line below.

With ActiveDocument.Styles("Table Normal").Table.Condition(wdFirstRow).Font

now , code is running without any error.

thing is that you need to pass valid parameter value for styles.

you can modify it as per your requirement.

you can also refer link below may give you some additional information.

Styles Collection Object

Style Object (Word)

Regards

Deepak


这篇关于无法在Word for Mac中创建宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆