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

VBA access for HTTP folders (MSN/Hotmail)



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 5th 06, 03:01 PM posted to microsoft.public.outlook.program_vba
Rayo K
external usenet poster
 
Posts: 16
Default VBA access for HTTP folders (MSN/Hotmail)

I have a macro that synchronizes my Outlook sent items with my MSN account
sent items (for when I send mail via the website or another computer). The
macro seems to work fine as long as the connection remains. However, if the
connection is lost and it shifts to offline mode, the prgoram crashes.

Is there a way for VB to check if the target folder is "online"? I think
that if I run that check before trying to access the folder, it will work.

Thanks
Rayo
  #2  
Old December 6th 06, 07:18 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default VBA access for HTTP folders (MSN/Hotmail)



Do you use an error handler? A simply On Errot Goto should prevent your code
from "crashing".

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Tue, 5 Dec 2006 06:01:01 -0800 schrieb Rayo K:

I have a macro that synchronizes my Outlook sent items with my MSN account
sent items (for when I send mail via the website or another computer). The
macro seems to work fine as long as the connection remains. However, if

the
connection is lost and it shifts to offline mode, the prgoram crashes.

Is there a way for VB to check if the target folder is "online"? I think
that if I run that check before trying to access the folder, it will work.

Thanks
Rayo

  #3  
Old December 6th 06, 08:07 PM posted to microsoft.public.outlook.program_vba
Rayo K
external usenet poster
 
Posts: 16
Default VBA access for HTTP folders (MSN/Hotmail)

Thanks.

I thought about that and it could probably work. The problem is that the
error only occurs when I use the item.copy.move method. The result is that
the code terminates with a copy already made (I don't understand why it can
copy an email into the folder but not move it).

So I need to 'trigger' a potential error event before that code executes,
without actually changing anything if the error occurs. So I don't know how
to apply an error handler to this situation. Any ideas?

-Rayo

"Michael Bauer [MVP - Outlook]" wrote:



Do you use an error handler? A simply On Errot Goto should prevent your code
from "crashing".

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Tue, 5 Dec 2006 06:01:01 -0800 schrieb Rayo K:

I have a macro that synchronizes my Outlook sent items with my MSN account
sent items (for when I send mail via the website or another computer). The
macro seems to work fine as long as the connection remains. However, if

the
connection is lost and it shifts to offline mode, the prgoram crashes.

Is there a way for VB to check if the target folder is "online"? I think
that if I run that check before trying to access the folder, it will work.

Thanks
Rayo


  #4  
Old December 7th 06, 07:36 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default VBA access for HTTP folders (MSN/Hotmail)



For instance:

On Error REsume Next
Dim Copy as MailItem

Set Copy=Item.Copy
If Err.Number Then
Copy.Delete
Set Copy=Nothing
Else
Copy.Move ...
Endif


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Wed, 6 Dec 2006 11:07:02 -0800 schrieb Rayo K:

Thanks.

I thought about that and it could probably work. The problem is that the
error only occurs when I use the item.copy.move method. The result is that
the code terminates with a copy already made (I don't understand why it

can
copy an email into the folder but not move it).

So I need to 'trigger' a potential error event before that code executes,
without actually changing anything if the error occurs. So I don't know

how
to apply an error handler to this situation. Any ideas?

-Rayo

"Michael Bauer [MVP - Outlook]" wrote:



Do you use an error handler? A simply On Errot Goto should prevent your

code
from "crashing".

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Tue, 5 Dec 2006 06:01:01 -0800 schrieb Rayo K:

I have a macro that synchronizes my Outlook sent items with my MSN

account
sent items (for when I send mail via the website or another computer).

The
macro seems to work fine as long as the connection remains. However, if

the
connection is lost and it shifts to offline mode, the prgoram crashes.

Is there a way for VB to check if the target folder is "online"? I

think
that if I run that check before trying to access the folder, it will

work.

Thanks
Rayo


  #5  
Old December 7th 06, 02:10 PM posted to microsoft.public.outlook.program_vba
Rayo K
external usenet poster
 
Posts: 16
Default VBA access for HTTP folders (MSN/Hotmail)

Thanks. That works, but now i would like to terminate the program as soon as
it finds it is offline. I think it should look something like this:

If FCopy Then
'If the server is not connected, it will not copy the email
*** On Error Goto [?] **************
Set itemCopy = item1.Copy
If Err.Number Then
itemCopy.Delete
Set itemCopy = Nothing
Else
itemCopy.Move folder2
totalCopied = totalCopied + 1

End If

'item1.Copy.Move folder2
'totalCopied = totalCopied + 1
End If

I'm not familiar with the Goto clause. What do I need to put after goto (I
want to stop the program and create a message box stating the folder is
offline)
\
Thanks
-Rayo

"Michael Bauer [MVP - Outlook]" wrote:



For instance:

On Error REsume Next
Dim Copy as MailItem

Set Copy=Item.Copy
If Err.Number Then
Copy.Delete
Set Copy=Nothing
Else
Copy.Move ...
Endif


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Wed, 6 Dec 2006 11:07:02 -0800 schrieb Rayo K:

Thanks.

I thought about that and it could probably work. The problem is that the
error only occurs when I use the item.copy.move method. The result is that
the code terminates with a copy already made (I don't understand why it

can
copy an email into the folder but not move it).

So I need to 'trigger' a potential error event before that code executes,
without actually changing anything if the error occurs. So I don't know

how
to apply an error handler to this situation. Any ideas?

-Rayo

"Michael Bauer [MVP - Outlook]" wrote:



Do you use an error handler? A simply On Errot Goto should prevent your

code
from "crashing".

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Tue, 5 Dec 2006 06:01:01 -0800 schrieb Rayo K:

I have a macro that synchronizes my Outlook sent items with my MSN

account
sent items (for when I send mail via the website or another computer).

The
macro seems to work fine as long as the connection remains. However, if
the
connection is lost and it shifts to offline mode, the prgoram crashes.

Is there a way for VB to check if the target folder is "online"? I

think
that if I run that check before trying to access the folder, it will

work.

Thanks
Rayo


  #6  
Old December 8th 06, 07:53 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default VBA access for HTTP folders (MSN/Hotmail)



There're two possibilities:

'On Error Resume Next' ignores the error and you can check in the next line
of code if an error occured. See my first sample.

'On Error Goto AnyName' jumps to a xxx (I don't know how to translate that).
That would look like this:

On Error Goto AnyName

' code here that raises an error
' more code here but these line won't be executed

AnyName: ' this is the xxx. Note that it ends with a double point!
' here the execution goes on

Both methods are possible if you want to leave the procedure. In my first
sample you could add a line like this:

If Err.Number Then
itemCopy.Delete
Set itemCopy = Nothing
Exit Sub
Endif


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Am Thu, 7 Dec 2006 05:10:01 -0800 schrieb Rayo K:

Thanks. That works, but now i would like to terminate the program as soon

as
it finds it is offline. I think it should look something like this:

If FCopy Then
'If the server is not connected, it will not copy the email
*** On Error Goto [?] **************
Set itemCopy = item1.Copy
If Err.Number Then
itemCopy.Delete
Set itemCopy = Nothing
Else
itemCopy.Move folder2
totalCopied = totalCopied + 1

End If

'item1.Copy.Move folder2
'totalCopied = totalCopied + 1
End If

I'm not familiar with the Goto clause. What do I need to put after goto (I
want to stop the program and create a message box stating the folder is
offline)
\
Thanks
-Rayo

"Michael Bauer [MVP - Outlook]" wrote:



For instance:

On Error REsume Next
Dim Copy as MailItem

Set Copy=Item.Copy
If Err.Number Then
Copy.Delete
Set Copy=Nothing
Else
Copy.Move ...
Endif


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Wed, 6 Dec 2006 11:07:02 -0800 schrieb Rayo K:

Thanks.

I thought about that and it could probably work. The problem is that the
error only occurs when I use the item.copy.move method. The result is

that
the code terminates with a copy already made (I don't understand why it

can
copy an email into the folder but not move it).

So I need to 'trigger' a potential error event before that code

executes,
without actually changing anything if the error occurs. So I don't know

how
to apply an error handler to this situation. Any ideas?

-Rayo

"Michael Bauer [MVP - Outlook]" wrote:



Do you use an error handler? A simply On Errot Goto should prevent your

code
from "crashing".

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Am Tue, 5 Dec 2006 06:01:01 -0800 schrieb Rayo K:

I have a macro that synchronizes my Outlook sent items with my MSN

account
sent items (for when I send mail via the website or another computer).

The
macro seems to work fine as long as the connection remains. However,

if
the
connection is lost and it shifts to offline mode, the prgoram crashes.

Is there a way for VB to check if the target folder is "online"? I

think
that if I run that check before trying to access the folder, it will

work.

Thanks
Rayo


 




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 access to Hotmail/Windows Live mail/MSN Mail Simon Outlook - General Queries 1 October 25th 06 02:21 PM
Cannot access my paid MSN Hotmail Plus account through Outlook Stefanos Athanasiadis Outlook - Installation 3 July 31st 06 05:01 PM
I cannot access my MSN Hotmail Plus account through Outlook 2003 Stefanos Athanasiadis Outlook - Installation 2 July 30th 06 07:20 AM
how to access hotmail folders other than inbox with outlook express [email protected] Outlook Express 5 January 20th 06 07:02 PM


All times are GMT +1. The time now is 08:33 PM.


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.