How to dock the Styles Task Pane in the e-mail editing window?

Status
Not open for further replies.

evdbogaard

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
I'm looking for VBA code to dock the Styles Task Pane to the right side of the mail editing window.
In Word 2010 I can do this with this code:

With Application.TaskPanes(wdTaskPaneFormatting)
If .Visible = False Then .Visible = True
CommandBars("Task Pane").Position = 2 'msoBarRight
End With

But I can't figure out how to do this in Outlook 2010 VBA.
 
this opens it (but docking is causing an error) - code samples taken from Use a Default Subject for New Messages and Use Word Macro to Apply Formatting to Email

Code:
' Based on http://www.vboffice.net/en/developers/newinspector-and-inspector-activate
Private WithEvents m_Inspectors As Outlook.Inspectors
Private WithEvents m_Inspector As Outlook.Inspector

Private Sub Application_Startup()
  Set m_Inspectors = Application.Inspectors
End Sub

Private Sub m_Inspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
  Set m_Inspector = Inspector
End Sub

Private Sub m_Inspector_Activate()
    Dim objWord As Word.Application
    Dim objDoc As Word.Document
    Dim objItem As Object
    Dim objInsp As Outlook.Inspector
  
Set objItem = m_Inspector.CurrentItem
Set objInsp = objItem.GetInspector
If objInsp.EditorType = olEditorWord Then
    Set objDoc = objInsp.WordEditor
    Set objWord = objDoc.Application
             
With objWord.TaskPanes(wdTaskPaneFormatting)
If .Visible = False Then .Visible = True

'  objWord.CommandBars("Task Pane").Position = 2 'msoBarRight
End With
End If
  Set m_Inspector = Nothing
 

End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
F VBA code to dock Styles whenever I write or edit an email Outlook VBA and Custom Forms 0
V Outlook Forms: Formatting a Label with 2 different styles Outlook VBA and Custom Forms 1
M How can I get new styles for Outlook Today 2003? Using Outlook 1
D Styles in Outlook 2010 Using Outlook 7
D Printing Styles No Headers Wanted Using Outlook 1
J Changing Colors or Font Styles on the Outlook Bar Using Outlook 1
D Formatting Styles when Replying Using Outlook 10
sjbtax Update Task Custom Field based upon Task Overdue Status Outlook VBA and Custom Forms 8
B Requesting VBA code to make Outlook prompt for confirmation when deleting a task? Outlook VBA and Custom Forms 4
T Why do Outlook Desktop 2021 tasks from my wife's email show up in my task pane? Using Outlook 2
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
D Copy Appointment Body to Task Body Outlook VBA and Custom Forms 0
K Daily Task List Minimized Cannot Display Using Outlook 5
wayneame Changing the Form Used by Existing Task Items in a Folder Outlook VBA and Custom Forms 4
S Outlook 2016 Understand and customize prepended behavior of recurring task Using Outlook 0
B Outlook 365 Populate Outlook Task UDFs from a UDF text string Outlook VBA and Custom Forms 2
K Multiple copies of task being created Using Outlook 2
P Short Date Format when typing in a task Using Outlook 2
C Outlook 2013 Task Recurrence - Third Friday After the Second Tuesday Using Outlook 2
P Task display now leaves little room for notes Using Outlook 10
C-S-R How to clear an Outlook (To Do) Task Flag? Using Outlook 8
G Event when creating task from mailitem Outlook VBA and Custom Forms 2
P Changing the font that the task view shows Using Outlook 5
D How To Combine Share Task Folders in just one Folder Using Outlook 0
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 2
G Arggh, weakness of reminder for every Task recurrence Using Outlook 0
P Can't paste an image into a task Using Outlook 3
F Validation on custom task form after task acceptance Outlook VBA and Custom Forms 1
J Office 365 erased all of my task views Using Outlook 3
T Report For Task Recurrance Outlook VBA and Custom Forms 4
E Can't accept or decline task (no button appears) Using Outlook 2
Z VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
Z Task Filter Not Working When I add too many criteria Using Outlook 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
Z How to show concatenated categories in list task view? Using Outlook 2
Z VBA to Collapse Task Folder Groups Outlook VBA and Custom Forms 1
E To convert imported data to custom fields in Task list Outlook VBA and Custom Forms 1
I Help with dates in task list. Using Outlook 5
Y Outlook Task View - Table Format - Customize Reminder Time to Drop-Down Selection Using Outlook 2
M Daily Task List Minimized Cannot Display Using Outlook 2
D Using a VBA Custom Form to Send Reoccurring Email Upon Task Completion Outlook VBA and Custom Forms 4
P Add a contact to the New Task in Outlook 2016 Using Outlook 2
S Codes for "Mark Complete" the task Outlook VBA and Custom Forms 2
W Deleting Sent Task Email, Deletes the task from my list Using Outlook 1
K Task priority modification Using Outlook 4
F Search folder for tasks in all task folders Using Outlook 1
JohnViuf Export task list view settings to other pc Outlook VBA and Custom Forms 16
V Changing default date for task follow-up buttons Using Outlook 2
K outlook workflow: automated task generation Outlook VBA and Custom Forms 4
U HTML Task Alternate Home Page View Control Using Outlook 3

Similar threads

Back
Top