Skip to content

Commit

Permalink
Fixed bugs in Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Linda Caputo committed Feb 25, 2019
1 parent ac82f9d commit 263966f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 33 deletions.
17 changes: 11 additions & 6 deletions Office-Mac/AppleScriptTask.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ ms.prod: office
ms.date: 06/08/2017
localization_priority: Priority
---

# Run an AppleScript with VB

Call an AppleScript file from a VB macro in Office 2016 for Mac.

***Applies to:*** *Excel for Mac | PowerPoint for Mac | Word for Mac | Office 2016 for Mac*
**Applies to**: Excel for Mac | PowerPoint for Mac | Word for Mac | Office 2016 for Mac

The **AppleScriptTask** command executes an AppleScript script file located outside the sandboxed app.

Expand All @@ -21,18 +22,21 @@ The following code shows how to call **AppleScriptTask** from VB.

The MyAppleScript.applescript file must be in ~/Library/Application Scripts/[bundle id]/. The .applescript extension is not required; you can also use the .scpt extension.

“Myapplescripthandler” is the name of a script handler in the MyAppleScript.applescript file.
“My parameter string” is the single input parameter to the “myapplescripthandler” script handler.
`Myapplescripthandler` is the name of a script handler in the `MyAppleScript.applescript` file.

`My parameter string` is the single input parameter to the `myapplescripthandler` script handler.

The following are the [bundle id] values for Excel, PowerPoint, and Word:

- com.microsoft.Word
- com.microsoft.Excel
- com.microsoft.Powerpoint

For example, the corresponding AppleScript for Excel would be in a file named "MyAppleScriptFile.applescript" that is in ~/Library/Application Scripts/com.microsoft.Excel/.
For example, the corresponding AppleScript for Excel would be in a file named `MyAppleScriptFile.applescript` that is in ~/Library/Application Scripts/com.microsoft.Excel/.

> [!IMPORTANT]
> The folders such as `com.microsoft.Excel` may not exist. In that case, just create them by using a standard **mk dir** command.
Remember: The folders com.microsoft.Excel etc. may not exist. In that case, just create them using standard "mk dir" command.
The following is an example of a handler.

```vb
Expand All @@ -44,7 +48,8 @@ The following is an example of a handler.
end myapplescripthandler
```

##What happened to MacScript?
## What happened to MacScript?

Earlier versions of Office for Mac implemented a command called **MacScript** that supported inline AppleScripts. Although that command still exists in Office 2016 for Mac, **MacScript** is deprecated. Due to sandbox restrictions, the **MacScript** command cannot invoke other applications, such as Finder, in Office 2016 for Mac. We recommend that you use the **AppleScriptTask** command instead of the **MacScript** command in apps for Office 2016 for Mac.

[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
31 changes: 12 additions & 19 deletions api/Word.Range.Sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ms.prod: word
api_name:
- Word.Range.Sort
ms.assetid: 2030f99e-0307-d2b7-9e14-1d0888f3fda6
ms.date: 06/08/2017
ms.date: 02/26/2019
localization_priority: Normal
---

Expand All @@ -19,41 +19,38 @@ Sorts the paragraphs in the specified range.

## Syntax

_expression_. `Sort`( `_ExcludeHeader_` , `_FieldNumber_` , `_SortFieldType_` , `_SortOrder_` , `_FieldNumber2_` , `_SortFieldType2_` , `_SortOrder2_` , `_FieldNumber3_` , `_SortFieldType3_` , `_SortOrder3_` , `_SortColumn_` , `_Separator_` , `_CaseSensitive_` , `_BidiSort_` , `_IgnoreThe_` , `_IgnoreKashida_` , `_IgnoreDiacritics_` , `_IgnoreHe_` , `_LanguageID_` )
_expression_.**Sort** (_ExcludeHeader_, _FieldNumber_, _SortFieldType_, _SortOrder_, _FieldNumber2_, _SortFieldType2_, _SortOrder2_, _FieldNumber3_, _SortFieldType3_, _SortOrder3_, _SortColumn_, _Separator_, _CaseSensitive_, _BidiSort_, _IgnoreThe_, _IgnoreKashida_, _IgnoreDiacritics_, _IgnoreHe_, _LanguageID_)

_expression_ Required. A variable that represents a '[Range](Word.Range.md)' object.
_expression_ Required. A variable that represents a **[Range](Word.Range.md)** object.


## Parameters



|Name|Required/Optional|Data type|Description|
|:-----|:-----|:-----|:-----|
| _ExcludeHeader_|Optional| **Variant**| **True** to exclude the first row or paragraph header from the sort operation. The default value is **False**.|
| _FieldNumber_|Optional| **Variant**|The fields by which to sort. Microsoft Word sorts by FieldNumber, then by FieldNumber2, and then by FieldNumber3.|
| _SortFieldType_|Optional| **Variant**|The respective sort types for FieldNumber. Can be one of the **WdSortFieldType** constants. The default value is **wdSortFieldAlphanumeric**. Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.|
| _SortOrder_|Optional| **Variant**|The sorting order to use when sorting FieldNumber. Can be any **WdSortOrder** constant.|
| _SortFieldType_|Optional| **Variant**|The respective sort types for FieldNumber. Can be one of the **WdSortFieldType** constants. The default value is **wdSortFieldAlphanumeric**. Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.|
| _SortOrder_|Optional| **Variant**|The sorting order to use when sorting FieldNumber. Can be any **WdSortOrder** constant.|
| _FieldNumber2_|Optional| **Variant**|The fields by which to sort.|
| _SortFieldType2_|Optional| **Variant**|The respective sort types for FieldNumber2. Can be one of the **WdSortFieldType** constants. The default value is **wdSortFieldAlphanumeric**. Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.|
| _SortOrder2_|Optional| **Variant**|The sorting order to use when sorting FieldNumber2. Can be any **WdSortOrder** constant.|
| _SortFieldType2_|Optional| **Variant**|The respective sort types for FieldNumber2. Can be one of the **WdSortFieldType** constants. The default value is **wdSortFieldAlphanumeric**. Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.|
| _SortOrder2_|Optional| **Variant**|The sorting order to use when sorting FieldNumber2. Can be any **WdSortOrder** constant.|
| _FieldNumber3_|Optional| **Variant**|The fields by which to sort.|
| _SortFieldType3_|Required||Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you?ve selected or installed. The default value is **wdSortFieldAlphanumeric**. Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.|
| _SortOrder3_|Optional| **Variant**|The sorting order to use when sorting FieldNumber3. Can be any **WdSortOrder** constant.|
| _SortFieldType3_|Required||Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed. The default value is **wdSortFieldAlphanumeric**.|
| _SortOrder3_|Optional| **Variant**|The sorting order to use when sorting FieldNumber3. Can be any **WdSortOrder** constant.|
| _SortColumn_|Optional| **Variant**| **True** to sort only the column specified by the **Range** object.|
| _Separator_|Optional| **Variant**|The type of field separator. Can be one of the **WdSortSeparator** constants.|
| _Separator_|Optional| **Variant**|The type of field separator. Can be one of the **WdSortSeparator** constants.|
| _CaseSensitive_|Optional| **Variant**| **True** to sort with case sensitivity. The default value is **False**.|
| _BidiSort_|Optional| **Variant**| **True** to sort based on right-to-left language rules. This argument may not be available to you, depending on the language support (U.S. English, for example) that you?ve selected or installed.|
| _IgnoreThe_|Optional| **Variant**| **True** to ignore the Arabic character alef lam when sorting right-to-left language text. This argument may not be available to you, depending on the language support (U.S. English, for example) that you?ve selected or installed.|
| _IgnoreKashida_|Optional| **Variant**| **True** to ignore kashidas when sorting right-to-left language text. This argument may not be available to you, depending on the language support (U.S. English, for example) that you?ve selected or installed.|
| _IgnoreDiacritics_|Optional| **Variant**| **True** to ignore bidirectional control characters when sorting right-to-left language text. This argument may not be available to you, depending on the language support (U.S. English, for example) that you?ve selected or installed.|
| _IgnoreHe_|Optional| **Variant**| **True** to ignore the Hebrew character he when sorting right-to-left language text. This argument may not be available to you, depending on the language support (U.S. English, for example) that you?ve selected or installed.|
| _LanguageID_|Optional| **Variant**|Specifies the sorting language. Can be one of the **WdLanguageID** constants. Refer to the Object Browser for a list of the **WdLanguageID** constants.|
| _LanguageID_|Optional| **Variant**|Specifies the sorting language. Can be one of the **WdLanguageID** constants. Refer to the Object Browser for a list of the **WdLanguageID** constants.|

## Example

This example inserts three lines of text into a new document and then sorts the lines in ascending alphanumeric order

This example inserts three lines of text into a new document and then sorts the lines in ascending alphanumeric order.

```vb
Sub NewParagraphSort()
Expand All @@ -66,9 +63,5 @@ End Sub
```


## See also


[Range Object](Word.Range.md)

[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
10 changes: 6 additions & 4 deletions api/Word.WdKeyCategory.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ms.prod: word
api_name:
- Word.WdKeyCategory
ms.assetid: 8389e00c-776f-5066-bfeb-f1f81ac85319
ms.date: 06/08/2017
ms.date: 02/26/2019
localization_priority: Normal
---

Expand All @@ -13,18 +13,20 @@ localization_priority: Normal

Specifies the type of item assigned to the key binding.


<br/>

|Name|Value|Description|
|:-----|:-----|:-----|
| **wdKeyCategoryAutoText**|4|Key is assigned to autotext.|
| **wdKeyCategoryCommand**|1|Key is assigned to a command|
| **wdKeyCategoryCommand**|1|Key is assigned to a command.|
| **wdKeyCategoryDisable**|0|Key is disabled.|
| **wdKeyCategoryFont**|3|Key is assigned to a font.|
| **wdKeyCategoryMacro**|2|Key is assigned to a|
| **wdKeyCategoryMacro**|2|Key is assigned to a macro.|
| **wdKeyCategoryNil**|-1|Key is not assigned.|
| **wdKeyCategoryPrefix**|7|Key is assigned to a prefix.|
| **wdKeyCategoryStyle**|5|Key is assigned to a style.|
| **wdKeyCategorySymbol**|6|Key is assigned to a symbol.|



[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ Custom Task Panes that attached to a top level window in MDI are now attached to

To summarize, as a developer, you will want to:


- Ensure that for any workbooks where you want to want to show the custom task pane, you write code to explicitly do that.
- Ensure that for any workbooks where you want to show the custom task pane, you write code to explicitly do that.

- Ensure that you explicitly handle updating the custom task pane state across all instances, if you want all of the custom task panes to reflect the same state. For example, a check box is toggled to ON by the user, and you want that to be reflected across all of the custom task panes in all instances of Excel.

Expand All @@ -138,12 +137,10 @@ Custom ribbon tabs and controls that assumed a single ribbon UI per application

If you want to keep all the ribbon UI controls in the same state across open workbooks, you will need to:


- Ensure that the code is able to cycle through the workbook windows and update the state of the controls.

OR


- Cache the state of the controls so that when the user switches to another workbook, that event can be captured and the controls updated as part of the window switch.

Additionally, consider the case where you develop code to add a custom UI control by using `Application.Commandbar` to access the ribbon. When you try to access that control at a later time, your code will need to account for the fact that the active workbook may not be the same workbook where you added the control.
Expand Down

0 comments on commit 263966f

Please sign in to comment.