J
John E.
Sue,
Am trying to adapt your Listing 24.4 to my needs to make objContact entries
into what is selected as Current Folder. Program runs and works but all
objContact entries show up in the default Contacts folder rather than the
selected current folder. With Watches set during Debut I can see that the
Current Folder is getting selected OK, and the code is creating
objContacts...just not in the current folder. Can you take a look at this
partila listng of the code and tell me what is wrong. The Watch on
objCurrentFolder in line 5 shows for sure it is at the current folder I want
the objContacts to go to, but they go into the default Contacts folder
instead:
Set objWB = objExcel.Workbooks.Add("C:\ExcelDL.xls")
Set objWS = objWB.Worksheets(1)
Set objRange = objWS.Range("test")
Set objApp = CreateObject("Outlook.Application")
Set objCurrentFolder = objApp.ActiveExplorer.CurrentFolder
If Not objCurrentFolder Is Nothing Then
intRowCount = objRange.Rows.Count
If intRowCount > 0 Then
For I = 1 To intRowCount
Set objContact = objApp.CreateItem(olContactItem)
With objContact
.FullName = objRange.Cells(I, 1)
.Email1AddressType = objRange.Cells(I, 3)
.Email1Address = objRange.Cells(I, 2)
.Save
End With
Next
End If
End If
Am trying to adapt your Listing 24.4 to my needs to make objContact entries
into what is selected as Current Folder. Program runs and works but all
objContact entries show up in the default Contacts folder rather than the
selected current folder. With Watches set during Debut I can see that the
Current Folder is getting selected OK, and the code is creating
objContacts...just not in the current folder. Can you take a look at this
partila listng of the code and tell me what is wrong. The Watch on
objCurrentFolder in line 5 shows for sure it is at the current folder I want
the objContacts to go to, but they go into the default Contacts folder
instead:
Set objWB = objExcel.Workbooks.Add("C:\ExcelDL.xls")
Set objWS = objWB.Worksheets(1)
Set objRange = objWS.Range("test")
Set objApp = CreateObject("Outlook.Application")
Set objCurrentFolder = objApp.ActiveExplorer.CurrentFolder
If Not objCurrentFolder Is Nothing Then
intRowCount = objRange.Rows.Count
If intRowCount > 0 Then
For I = 1 To intRowCount
Set objContact = objApp.CreateItem(olContactItem)
With objContact
.FullName = objRange.Cells(I, 1)
.Email1AddressType = objRange.Cells(I, 3)
.Email1Address = objRange.Cells(I, 2)
.Save
End With
Next
End If
End If