Re: Word 2011 - Executing VBA from an AppleScript?
Re: Word 2011 - Executing VBA from an AppleScript?
- Subject: Re: Word 2011 - Executing VBA from an AppleScript?
- From: Dave <email@hidden>
- Date: Thu, 17 Mar 2016 20:36:22 +0000
Hi Stan,
That’s a great help thanks!
Does anyone know offhand what new line character I need to use to put together a Script String?
All the Best
Dave
> On 17 Mar 2016, at 18:51, Stan Cleveland <email@hidden> wrote:
>
>> On Mar 17, 2016, at 06:51 AM, Dave <email@hidden> wrote:
>>
>> I found this:
>>
>> tell application "Microsoft Word"
>> set vbCode to "ActiveDocument.CustomDocumentProperties(\"foo\").Delete"
>> do Visual Basic vbCode
>> end tell
>>
>> But SE errors on “do Visual Basic vbCode”, does VBA still work on Word 2011?
>
> Hi Dave,
>
> Microsoft removed the ‘do Visual Basic’ command from Word 2011’s AppleScript dictionary, but they do NOT seem to have removed the underlying functionality. Try using the raw (chevron) syntax in place of the AS command:
>
> tell application "Microsoft Word"
> set vbCode to "ActiveDocument.CustomDocumentProperties(\"foo\").Delete"
> «event MSWDdovb» vbCode
> end tell
>
> I created a custom property named "foo", then ran the above script. The "foo" property was deleted.
>
> HTH,
> Stan C.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden