A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Program not working for public account in Outlook.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 5th 07, 10:37 PM posted to microsoft.public.outlook.program_vba
joshnya2
external usenet poster
 
Posts: 5
Default Program not working for public account in Outlook.

I created a program that works fine when I am using my own personal
Exchange profile in
Outlook. It creates a series of appointments on my calendar and then
invites people that are pulled from a custom form.

When I switch over to a public account I have full access to and run
the
program I get "Operation aborted (Exception from HRESULT: 0x80004004
(E_ABORT))"

The error is indicating I have an issue with this line of code:

objAppt = objOL.CreateItem(olAppointmentItem)


I have had several people at my office look at this and all are
baffled. Any
clues/ideas/suggestions are very welcome. Thanks!

If requested I will post the entire code.

Ads
  #2  
Old September 6th 07, 06:46 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Program not working for public account in Outlook.

You are missing a Set statement with that line of code, but I don't imagine
that your problem will be solved that easily!

What exactly do you mean by a "public" account? Also, go ahead and post
your full code.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"joshnya2" wrote:

I created a program that works fine when I am using my own personal
Exchange profile in
Outlook. It creates a series of appointments on my calendar and then
invites people that are pulled from a custom form.

When I switch over to a public account I have full access to and run
the
program I get "Operation aborted (Exception from HRESULT: 0x80004004
(E_ABORT))"

The error is indicating I have an issue with this line of code:

objAppt = objOL.CreateItem(olAppointmentItem)


I have had several people at my office look at this and all are
baffled. Any
clues/ideas/suggestions are very welcome. Thanks!

If requested I will post the entire code.


  #3  
Old September 6th 07, 10:16 PM posted to microsoft.public.outlook.program_vba
joshnya2
external usenet poster
 
Posts: 5
Default Program not working for public account in Outlook.

By public I mean it is a dummy Outlook account that is used as a
"centralized" calendar for team tasks/schedules. There are 10 people
with full access to this account. My program places an appointment on
the default calendar then sends invites to certain people based upon
what was entered in my custom form. If I have *MY* account/calendar up
the program works perfectly. If I create a profile and log into
Outlook as the *other* account the program halts on the line of code I
indicated.

My code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim StartTime As ValueType
Dim EndTime As ValueType
StartTime = DateTimePicker1.Value
EndTime = DateTimePicker1.Value.AddHours(9)
Dim objOL 'As Outlook.Application
Dim objAppt 'As Outlook.AppointmentItem
Const olAppointmentItem = 1
Const olMeeting = 1

objOL = CreateObject("Outlook.Application")
objAppt = objOL.CreateItem(olAppointmentItem)

'If ListBox1.SelectedItem = ("") Then
' MsgBox("Please select a team member for Remedy RC Bucket,
Thanks.")
'ElseIf ListBox2.SelectedItem = ("") Then
' MsgBox("Please select a team member for Inbox, Thanks.")
'ElseIf ListBox3.SelectedItem = ("") Then
' MsgBox("Please select a team member for Remedy IS/MIIS
Buckets, Thanks.")
'ElseIf ListBox4.SelectedItem = ("") Then
' MsgBox("Please select a team member for Triage, Thanks.")
'Else

Dim Counter As Integer
Counter = 0

'shortName(ListBox5)
'With objAppt
' .Subject = (Label9.Text)
' .start = StartTime
' .End = DateTimePicker1.Value.AddDays(5)
' .Location = displayName
' .AllDayEvent = True



' ' make it a meeting request
' .MeetingStatus = olMeeting
' .RequiredAttendees = ListBox5.Text
' .Send()
'End With

'Do While Counter 2

'This is the appointment for the first task
shortName(ListBox1)

With objAppt
.Subject = (Label1.Text)
.start = StartTime
.End = EndTime
.Location = displayName
'.AllDayEvent = True

' make it a meeting request
.MeetingStatus = olMeeting
.RequiredAttendees = ListBox1.Text
.Send()

End With

Thanks for any time/effort spent on my behalf. This was my first time
working with VBScript and it's been interesting to say the least

  #4  
Old September 6th 07, 10:34 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Program not working for public account in Outlook.

For some reason I think you are loading another mailbox in your Outlook
profile and trying to programmatically create an Appointment item in the
Calendar stored in that mailbox. In those cases, you need to get that folder
by using the GetDefaultSharedFolder method and use the Items.Add method to
create a new item in that folder.

But - if you aren't doing that - the only thing I can think of is that you
don't have permissions on that Calendar. Can you create items there manually?

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"joshnya2" wrote:

By public I mean it is a dummy Outlook account that is used as a
"centralized" calendar for team tasks/schedules. There are 10 people
with full access to this account. My program places an appointment on
the default calendar then sends invites to certain people based upon
what was entered in my custom form. If I have *MY* account/calendar up
the program works perfectly. If I create a profile and log into
Outlook as the *other* account the program halts on the line of code I
indicated.

My code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim StartTime As ValueType
Dim EndTime As ValueType
StartTime = DateTimePicker1.Value
EndTime = DateTimePicker1.Value.AddHours(9)
Dim objOL 'As Outlook.Application
Dim objAppt 'As Outlook.AppointmentItem
Const olAppointmentItem = 1
Const olMeeting = 1

objOL = CreateObject("Outlook.Application")
objAppt = objOL.CreateItem(olAppointmentItem)

'If ListBox1.SelectedItem = ("") Then
' MsgBox("Please select a team member for Remedy RC Bucket,
Thanks.")
'ElseIf ListBox2.SelectedItem = ("") Then
' MsgBox("Please select a team member for Inbox, Thanks.")
'ElseIf ListBox3.SelectedItem = ("") Then
' MsgBox("Please select a team member for Remedy IS/MIIS
Buckets, Thanks.")
'ElseIf ListBox4.SelectedItem = ("") Then
' MsgBox("Please select a team member for Triage, Thanks.")
'Else

Dim Counter As Integer
Counter = 0

'shortName(ListBox5)
'With objAppt
' .Subject = (Label9.Text)
' .start = StartTime
' .End = DateTimePicker1.Value.AddDays(5)
' .Location = displayName
' .AllDayEvent = True



' ' make it a meeting request
' .MeetingStatus = olMeeting
' .RequiredAttendees = ListBox5.Text
' .Send()
'End With

'Do While Counter 2

'This is the appointment for the first task
shortName(ListBox1)

With objAppt
.Subject = (Label1.Text)
.start = StartTime
.End = EndTime
.Location = displayName
'.AllDayEvent = True

' make it a meeting request
.MeetingStatus = olMeeting
.RequiredAttendees = ListBox1.Text
.Send()

End With

Thanks for any time/effort spent on my behalf. This was my first time
working with VBScript and it's been interesting to say the least


  #5  
Old September 6th 07, 10:43 PM posted to microsoft.public.outlook.program_vba
joshnya2
external usenet poster
 
Posts: 5
Default Program not working for public account in Outlook.

I have full control over the shared calendar.

How would the structure work then to set the appointment on the shared
folder?

I am guessing I have to "load" the shared folder then start adding
items to it?

Thanks again!

  #6  
Old September 7th 07, 04:50 AM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Program not working for public account in Outlook.

Here's a sample from the Outlook VBA Help file. Again, this only applies if
you've loaded another mailbox in your profile.

Sub ResolveName()
Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim CalendarFolder As Outlook.MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("Dan Wilson")
myRecipient.Resolve
If myRecipient.Resolved Then
Call ShowCalendar(myNamespace, myRecipient)
End If
End Sub

Sub ShowCalendar(myNamespace, myRecipient)
Dim CalendarFolder As Outlook.MAPIFolder
Set CalendarFolder = _
myNamespace.GetSharedDefaultFolder _
(myRecipient, olFolderCalendar)
CalendarFolder.Display
End Sub

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"joshnya2" wrote:

I have full control over the shared calendar.

How would the structure work then to set the appointment on the shared
folder?

I am guessing I have to "load" the shared folder then start adding
items to it?

Thanks again!


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 not working with pop3 account Swit77 Outlook - Installation 20 February 11th 08 05:57 PM
My Account B is not working Kaidan 75 Outlook - Installation 1 June 14th 07 12:54 AM
Public folder calendars not working properly Phixit Outlook - Calandaring 3 May 10th 07 04:13 PM
how to i apply my cox email account to outlook express program? amivna Outlook - General Queries 1 October 2nd 06 10:10 AM
2002 outlook upgraded because program freeze, account deleted. Hel robbietlc Outlook - Installation 0 March 10th 06 11:36 PM


All times are GMT +1. The time now is 10:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.