Skip to content

Commit

Permalink
Merge pull request #1480 from MicrosoftDocs/lindalu-patch
Browse files Browse the repository at this point in the history
[admin] Update Outlook.Account.md
  • Loading branch information
lindalu-MSFT authored Dec 30, 2021
2 parents 1d2c46e + 85357ee commit 5b3f523
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions api/Outlook.Account.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,26 @@ ms.prod: outlook
api_name:
- Outlook.Account
ms.assetid: f624438c-4e45-2822-18b6-bfe8074a33c0
ms.date: 06/08/2017
ms.date: 12-29-2021
ms.localizationpriority: medium
---


# Account object (Outlook)

The **Account** object represents an account that is defined for the current profile.


## Remarks

The purpose of the [Accounts](Outlook.Accounts.md) collection object and the **Account** object is to provide the capacity to enumerate **Account** objects in a given profile, to identify the type of **Account**, and to use a specific **Account** object to send mail.


> [!NOTE]
> [!NOTE]
> Helmut Obertanner provided the following code samples. Helmut is a [Microsoft Most Valuable Professional](https://mvp.microsoft.com/) with expertise in Microsoft Office development tools in Microsoft Visual Studio and Microsoft Office Outlook.

## Example

The following managed code samples are written in C# and Visual Basic. To run a .NET Framework managed code sample that needs to call into a Component Object Model (COM), you must use an interop assembly that defines and maps managed interfaces to the COM objects in the object model type library. For Outlook, you can use Visual Studio and the Outlook Primary Interop Assembly (PIA). Before you run managed code samples for Outlook 2013, ensure that you have installed the Outlook 2013 PIA and have added a reference to the Microsoft Outlook 15.0 Object Library component in Visual Studio. You should use the following code samples in the `ThisAddIn` class of an Outlook add-in (using Office Developer Tools for Visual Studio). The **Application** object in the code must be a trusted Outlook **Application** object provided by `ThisAddIn.Globals`. For more information about using the Outlook PIA to develop managed Outlook solutions, see the **Welcome to the Outlook Primary Interop Assembly Reference** on MSDN.

The following code samples show the `DisplayAccountInformation` method of the `Sample` class, implemented as part of an Outlook add-in project. Each project adds a reference to the Outlook PIA, which is based on the **Microsoft.Office.Interop.Outlook** namespace. The `DisplayAccountInformation` method takes as an input argument a trusted Outlook[Application](Outlook.Application.md) object, and uses the **Account** object to display the details of each account that is available for the current Outlook profile.

The following two managed code samples are written in C# and Visual Basic. To run a .NET Framework managed code sample that needs to call into a Component Object Model (COM), you must use an interop assembly that defines and maps managed interfaces to the COM objects in the object model type library. For Outlook, you can use Visual Studio and the Outlook Primary Interop Assembly (PIA). Before you run managed code samples for Outlook 2013, ensure that you have installed the Outlook 2013 PIA and have added a reference to the Microsoft Outlook 15.0 Object Library component in Visual Studio. You should use the following code samples in the `ThisAddIn` class of an Outlook add-in (using Office Developer Tools for Visual Studio). The **Application** object in the code must be a trusted Outlook **Application** object provided by `ThisAddIn.Globals`. For more information about using the Outlook PIA to develop managed Outlook solutions, see the **Welcome to the Outlook Primary Interop Assembly Reference** on MSDN.

The code samples show the `DisplayAccountInformation` method of the `Sample` class, implemented as part of an Outlook add-in project. Each project adds a reference to the Outlook PIA, which is based on the **Microsoft.Office.Interop.Outlook** namespace. The `DisplayAccountInformation` method takes as an input argument a trusted Outlook[Application](Outlook.Application.md) object, and uses the **Account** object to display the details of each account that is available for the current Outlook profile.


```cs
Expand Down Expand Up @@ -104,8 +98,6 @@ namespace OutlookAddIn1
```




```vb
Imports Outlook = Microsoft.Office.Interop.Outlook

Expand Down

0 comments on commit 5b3f523

Please sign in to comment.