Bonjour à tous,
Je recherche une solution pour ajouter ou supprimer des colonnes du dossier que je créé automatiquement via VBA.
(https://outlook.developpez.com/faq/?...A_CreateFolder)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 Sub CreateDossier() Dim monOutlook As New Outlook.Application Dim ns As namespace Dim dossier As MAPIFolder Dim myNewFolder As MAPIFolder Set ns = monOutlook.GetNamespace("MAPI") Set dossier = ns.Folders("Dossiers personnels").Folders("Boîte de réception") Set myNewFolder = dossier.Folders.Add("Test") End Sub
J'ai cherché du côté des tables mais je n'arrive pas à modifier les colonnes du dossier..... (https://docs.microsoft.com/fr-fr/off...ok.columns.add)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 Sub AddColumns() 'Declarations Dim Filter As String Dim oRow As Outlook.Row Dim oTable As Outlook.Table Dim oFolder As Outlook.Folder 'Get a Folder object for the Inbox Set oFolder = Application.Session.GetDefaultFolder(olFolderInbox) 'Define Filter to obtain items last modified after May 1, 2005 Filter = "[LastModificationTime] > '5/1/2005'" 'Restrict with Filter Set oTable = oFolder.GetTable(Filter) 'Remove all columns in the default column set oTable.Columns.RemoveAll 'Specify desired properties With oTable.Columns .Add ("Subject") .Add ("LastModificationTime") 'PR_ATTR_HIDDEN referenced by the MAPI proptag namespace .Add ("http://schemas.microsoft.com/mapi/proptag/0x10F4000B") End With 'Enumerate the table using test for EndOfTable Do Until (oTable.EndOfTable) Set oRow = oTable.GetNextRow() Debug.Print (oRow("Subject")) Debug.Print (oRow("LastModificationTime")) Debug.Print (oRow("http://schemas.microsoft.com/mapi/proptag/0x10F4000B")) Loop End Sub
Je ne trouve pas beaucoup d'information sur internet non plus....
Auriez-vous des solutions ?
En vous remerciant par avance.
Partager