wonder if anyone can help... I have access db with a whole lot of vb code... If i use access 2000 it works perfectly but when using 2003 it doesn't work properly. The db copies outlook mailboxes... I'm not quite sure why it wont work properly, i can copy my own mailbox but trying to copy some elses wont work, if i export the mailboxes directly through outlook then i can copy them... this isn't an outlook related issue... here is the code which doesn't seem to work: -
Private Sub CopyMailItems(ns As Outlook.NameSpace, strUserFullName As String, strRecip As String)
-
On Error GoTo CopyErrHandler
-
-
Dim folder1 As MAPIFolder, oFolder As MAPIFolder
-
Dim strMailboxName As String, strStatus As String
-
Dim intConnect As Integer, intOther As Integer
-
Dim strDupTest As String, ErrString, strSearch As String
-
Dim Complete As Boolean
-
-
Set dbs = CurrentDb
-
Set rst = dbs.OpenRecordset("Status")
-
MsgBox "copymailitems1", vbOKOnly, "test"
-
intConnect = ConnectToBox()
-
If intConnect = 6 Then
-
MsgBox "copymailitems2", vbOKOnly, "test"
-
strMailboxName = "Mailbox - " & strUserFullName
-
Set UserMailbox = ns.Folders(strMailboxName)
-
'If user has not connected to mailbox, rest of code will not run. Error Handler will "kick in"
-
strStatus = StatusTest()
-
MsgBox "copymailitems3", vbOKOnly, "test"
-
If strStatus <> "Copy Started" Then
-
MsgBox "copymailitems4", vbOKOnly, "test"
-
strStatus = "Copy Started"
-
Call UpdateStatus(strStatus)
-
End If
-
Screen.MousePointer = 11
-
-
'Copy folders and its subfolders to empty pst
-
strPstFolderName = CreateEmptyPst(ns, strRecip, strUserFullName)
-
MsgBox "copymailitems5", vbOKOnly, "test"
-
Set PersonalFolder = ns.Folders(strPstFolderName)
-
For Each folder1 In UserMailbox.Folders 'ns.Folders(strMailboxName).Folders
-
MsgBox "copymailitems6", vbOKOnly, "test"
-
Set CopiedFolder = folder1.CopyTo(PersonalFolder) '****
-
MsgBox "copymailitems7", vbOKOnly, "test"
-
Next
-
MsgBox "copymailitems8", vbOKOnly, "test"
-
Set CopiedFolder = Nothing
-
'copy messages from top of Information Store to pst
-
For Each msg In ns.Folders(strMailboxName).Items
-
MsgBox "copymailitems9", vbOKOnly, "test"
-
Set CopiedItem = msg.Copy
-
CopiedItem.Move PersonalFolder
-
Next
-
Set CopiedItem = Nothing
-
Set oFolder = ns.Folders.Item(strPstFolderName)
-
-
Screen.MousePointer = 0
-
Complete = VerifyContents(ns, strMailboxName)
-
If Complete = True Then
-
MsgBox "All items have been copied.", vbOKOnly + vbInformation, "Mailbox Copy"
-
strStatus = "Copy Complete"
-
' Set objFolder = objName.Folders.Item("Personal Folders")
-
ns.RemoveStore PersonalFolder
-
Else
-
MsgBox "Please copy data to folders where differences have been noted. " & _
-
"Please revisit page once copying has been completed", vbOKOnly + vbInformation, _
-
"Mailbox Copy"
-
strStatus = "Copy Partial"
-
DoCmd.OpenForm "frmCopyComplete"
-
End If
-
Call UpdateStatus(strStatus)
-
End If
-
-
CopyErrHandler:
-
Select Case Err.Number
-
Case -2147221233 'Not connected to user's mailbox in Outlook
-
intConnect = ConnectToBox()
-
If intConnect = 6 Then
-
Resume
-
End If
-
Case Else
-
strSearch = "Can't copy folder." 'don't have permission to copy folder
-
ErrString = InStr(1, Err.Description, strSearch)
-
If ErrString = 1 Then
-
Resume Next
-
End If
-
End Select
-
-
Screen.MousePointer = 0
-
-
End Sub
-
-
i have added the msgboxs which says copymailitems, just to try see where it stops working... it would seem like it is after this line:
-
-
MsgBox "copymailitems6", vbOKOnly, "test"
-
Set CopiedFolder = folder1.CopyTo(PersonalFolder)
-
Any ideas or anything would be greatly appreciated...
Thanx
0 1529 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Thomi Richards |
last post by:
Hi,
I'm trying to create a simple stack class using C++ and templates.
Everything works well and good if I amke the class totally inline.
However, as soon as I try to seperate the class into a .h and a .cpp
file, gcc throws some strange linking errors.
Compiling like this:
|
by: Russ |
last post by:
Hello. My new dev machine is running XP Pro. In the past all
equipment has only used Windows 2000. I have had a lot of problems
getting my projects up and running on the new machine. The current
one is a permission error.
The project is a VC++ Web Service. It works fine when the service is
hosted on the old W2K dev machine, but on the...
|
by: Carmine Cairo |
last post by:
Hi,
I'm working on a project and today I've note a little problem during the
compile fase.
Here a little piece of code:
// 1st version
welldone = 0;
size = p->getSize();
backbone = new rightType;
|
by: Chris LaJoie |
last post by:
Our company has been developing a program in C# for some time now, and we
haven't had any problems with it, but just last night something cropped up
that has me, and everyone else, stumped.
I have a struct that contains several different types of data. This struct
is used throuout the program. Now, when I compile, I get 6 errors, all of...
|
by: Holger (David) Wagner |
last post by:
Hi Group,
I've searched the Web for precompilers that compile ASPX/ASCX pages just
like it can be done with JSPs, but so far, I've only found approaches
targetted at increasing the performance. What I'd like to do this for,
however, is discovering compile-time errors during my normal build.
Currently, just a typo in a Property name goes...
| |
by: collection60 |
last post by:
I've been developing some Unix based shell tools.
They work fine on Linux and MacOSX.
I want to compile them on Win32. But I can't get hash_map to compile. I
tried downloading stl (and stlport) which is supposed to work in MSVC,
but it doesn't, it just generates tons of errors for stuff that used to
work just fine.
Where do I get fts.h...
|
by: Boris Yeltsin |
last post by:
I use Master Pages, so I make use of URL rebasing through the ~ operator,
like this in the <head>:
<link runat="server" href="~/Root.master.css" media="screen"
rel="stylesheet" type="text/css" />
It works perfectly and the ~ gets converted by the server into the correct
relative path. Great!
Now, I put this in the <head>:
<script...
|
by: mistral |
last post by:
Need compile python code, source is in html and starts with parameters:
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
I have installed ActivePython for windows.
|
by: Finger.Octopus |
last post by:
I dont know whats terribly going wrong with this, well I know there's
some memory allocation with this but I tried hard to fix it and when
it gets fixed it doesn't shows up the desired value, this is the code
that shows the compile-time error:
#include <stdio.h>
#include <string.h>
#define $WORD_LIST(X) "resource/" X
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |