質問編集履歴

2

ソースコードの改善

2021/11/02 12:30

投稿

marina0504
marina0504

スコア3

test CHANGED
File without changes
test CHANGED
@@ -100,7 +100,7 @@
100
100
 
101
101
 
102
102
 
103
- For i = 1 To MyFolder_A.Ttems.Count
103
+ For i = 1 To MyFolder_A.Items.Count
104
104
 
105
105
  If InStr(MyItem.To, "test") > 0 Then
106
106
 
@@ -110,7 +110,7 @@
110
110
 
111
111
  MsgBox MyItem.To 'これを消すとエラーが発生する
112
112
 
113
- Set myItem = Aplication.ActiveExplorer().Selection(1)
113
+ Set MyItem = Aplication.ActiveExplorer().Selection(1)
114
114
 
115
115
  MyItem.GetInspectoy.Disply
116
116
 

1

ソースコードの改善

2021/11/02 12:30

投稿

marina0504
marina0504

スコア3

test CHANGED
File without changes
test CHANGED
@@ -86,11 +86,15 @@
86
86
 
87
87
 
88
88
 
89
- Set MyNameSpace = Aplication.GetName
90
89
 
91
- Set MyFolder_A = objNAMESPC.Folders(olFolderInbox).Folders("A")
92
90
 
91
+ Set MyNameSpace = Aplication.GetNamespace("MAPI")
92
+
93
+ Set MyMailFolder = MyNameSpace.GetDefaultFolder(olFolderInbox)
94
+
95
+ Set MyFolder_A = MymailFolder.Folders("A")
96
+
93
- Set MyFolder_B = objNAMESPC.Folders(olFolderInbox).Folders("B")
97
+ Set MyFolder_B = MymailFolder.Folders("B")
94
98
 
95
99
 
96
100
 
@@ -116,6 +120,8 @@
116
120
 
117
121
  MyItem.Move MyFolder_B
118
122
 
123
+
124
+
119
125
 
120
126
 
121
127
  End If