Re: In Outlook add a folder then move a message to it.

From: Dorian Chalom (DChalom_at_Comcast.net)
Date: 01/05/05

  • Next message: Mike Gagnon: "Re: In Outlook add a folder then move a message to it."
    Date: Wed, 5 Jan 2005 16:09:12 -0500
    
    

    But Mike, i am still getting an error message of "Unknown COM Status Code"
    on the Move statement. I am using VFP6.0 and Outlook 2002.
    Any ideas?

    "Mike Gagnon" <mgagnon23@hotmail.com> wrote in message
    news:%23sxJB8X8EHA.3592@TK2MSFTNGP09.phx.gbl...
    > This will give you the folder ID number (the value i). Folders a usually
    > numbered by creation. So if you had 11 folders and you create a new one,
    > it would normally have the ID #12
    >
    > CLEAR
    > ON ERROR *
    > Local oOutlookObject,olNameSpace
    > #Define olFolderInBox 6
    > oOutlookObject = Createobject('Outlook.Application')
    > olNameSpace = oOutlookObject.GetNameSpace('MAPI')
    > oItems= olNameSpace.Folders(1).folders
    > FOR i = 1 TO 13
    > ?'Folder Name: '+olNameSpace.Folders(1).folders(i).name, ', ID number:
    > '+trans(i)
    > ENDFOR
    >
    > "Dorian Chalom" <DChalom@Comcast.net> wrote in message
    > news:OTojDeT8EHA.2572@tk2msftngp13.phx.gbl...
    >> Hi Mike!
    >>
    >> Glad to hear from you. Since I can no longer log into Tek-Tips.
    >>
    >> I am recieving an error message of "unknown COM error code" on the Move
    >> statement of the following code. Is there a way for me to determine the
    >> folder number of a folder?
    >>
    >> Thanks for any insight you can give and
    >> A Happy New Year!
    >>
    >> loMSend = oOutLookObject.CreateItem(0)
    >> m.Emp_eMail = tdbDoc.Emp_eMail
    >> loMSend.Recipients.Add(m.Emp_eMail)
    >> loMSend.Subject = tdbDoc.Subject
    >> loMSend.Body = tdbDoc.DocText
    >> DO WHILE tdbDoc.Emp_eMail = m.Emp_eMail .AND. .NOT. EOF("tdbDoc")
    >> IF lFwdDoc
    >> IF .NOT. ISBLANK(tdbDoc.DocFile)
    >> loMSend.Attachments.Add(tdbDoc.DocFile)
    >> ENDIF
    >> ENDIF
    >> SKIP IN tdbDoc
    >> ENDDO
    >> loMSend.Send()
    >> IF lOLSave
    >> * Find Folder
    >> lFound = .F.
    >> oFolders =thisform.OLGetFolder(cOLSaveFldr)
    >> oFolders =oFolders.folders
    >> FOR EACH oFolder IN oFolders
    >> IF cCase = oFolder.Name
    >> oFldr = oFolder
    >> lFound = .T.
    >> EXIT
    >> ENDIF
    >> ENDFOR
    >> IF .NOT. lFound
    >> oFldr=oFolders.Add(cCase)
    >> ENDIF
    >> loMRead.Move(oFldr)
    >> ENDIF
    >> loMRead.unRead = .F.
    >> IF lDelete
    >> loMRead.Delete()
    >> ENDIF
    >> RELEASE loMRead, loMSend
    >>
    >>
    >> "Mike Gagnon" <mgagnon23@hotmail.com> wrote in message
    >> news:eMqzxnN8EHA.3820@TK2MSFTNGP11.phx.gbl...
    >>> It may be just a case of your syntax, but I have had success with this
    >>> (After having determined the index number of the folder I want the
    >>> message to be to)
    >>> This example moves the unread message to the folder that has an index of
    >>> 12.
    >>>
    >>>
    >>> Local oOutlookObject,olNameSpace
    >>> #Define olFolderInBox 6
    >>> oOutlookObject = Createobject('Outlook.Application')
    >>> olNameSpace = oOutlookObject.GetNameSpace('MAPI')
    >>> oItems= olNameSpace.GetDefaultFolder(olFolderInBox).Items
    >>> For Each loItem In oItems
    >>> If !loItem.unRead
    >>> loitem.Move(olNameSpace.Folders(1).Folders(12))
    >>> Endif
    >>> Next
    >>>
    >>> "Dorian Chalom" <DChalom@Comcast.net> wrote in message
    >>> news:uRvEGS47EHA.3856@tk2msftngp13.phx.gbl...
    >>>>I am trying to figure out how to determine if a folder exists in
    >>>>Outlook.
    >>>> If it does not exist then create it.
    >>>> And either way then move the current message to that folder.
    >>>>
    >>>> Currently i have it workuing through the creating a folder if needed,
    >>>> but i cannot get the Move to work.
    >>>>
    >>>> Please,
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >


  • Next message: Mike Gagnon: "Re: In Outlook add a folder then move a message to it."

    Relevant Pages

    • RE: Switch from Power User to User
      ... they got an error message regarding Folder ... The SBS\\Users on SBS is the folder that is attempting to sync. ... All the workstations that have users that have been changed from Power User ... > Synchronize, how many offline folders you can see in the Items to ...
      (microsoft.public.windows.server.sbs)
    • RE: Offline Address Book error on send/receive
      ... address book can not be download error message after you joined the SBS ... navigate to the server entry. ... Please rebuild Offline Address Lists to see if it helps. ... Storage Group -> Public Folder Store, Does the store is mounted properly? ...
      (microsoft.public.windows.server.sbs)
    • Re: File problems
      ... original message, the response from Daave, my response to him, the response ... error message, but now it is 6 or more times A DAY. ... only to find that XP has ANOTHER glitch Windows 98 SE ... "Cannot remove folder: It is being used by another ...
      (microsoft.public.windowsxp.general)
    • Re: "Undeletable" File
      ... I hadn't tried FileASSASSAIN but, ... of its three deletion methods elicited the error message ... Open your backup program and restore the file you created to ... the folder where the undeletable file is, ...
      (microsoft.public.windowsxp.general)
    • RE: Config error using domain user for ASP.NET worker process
      ... Hello Mike, ... the error message. ... | Subject: RE: Config error using domain user for ASP.NET worker process ... Produced By Microsoft MimeOLE V5.50.4910.0300 ...
      (microsoft.public.dotnet.framework.aspnet.security)