Solved

Open text attachment from Groupwise and import it

Posted on 2004-04-05
15
296 Views
Last Modified: 2007-12-19
Having a bit of trouble with this..

What i want to do:

1. Search a Folder in Groupwise and Open all emails with attachment
2. Import it
3. Delete email


Ive searched all of EE and couldn't really find anything, had a look at the documentation on the Novell site and that didnt really help...  Looked at the Object Browser and i got lost...

If i can get to find the emails that are in there, i should be able to get the rest out...

Anyone done this / know where to look???

Dave
0
Comment
Question by:flavo
  • 9
  • 6
15 Comments
 
LVL 54

Accepted Solution

by:
nico5038 earned 500 total points
ID: 10761177
0
 
LVL 34

Author Comment

by:flavo
ID: 10761247
There was a better link for the Novell site in there..  Better than what i could find!
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10761321
I know it's a hard to do this and regrettably I have no groupwise nor experience with it to help you further, but hope this triggers some new insights !

Success !

Nic;o)
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 34

Author Comment

by:flavo
ID: 10762414
Getting there...
0
 
LVL 34

Author Comment

by:flavo
ID: 10762557
its working, but it dies all the time (Excel and Access crash..)

Any ideas???

heres the code - just prints it so far....
Sub PrintAttachments()

Dim oApp As Object
Dim oAcct As Object
Dim oFolders As Object
Dim oFolder As Object
Dim Cnt As Integer
Dim oMessages As Object
Dim oMessage As Message
Dim oAttach As Attachment


Set oApp = CreateObject("NovellGroupWareSession")
Set oAcct = oApp.Login("", "")
If oAcct.Remote = True Then
   'Text1.Text = "Remote"
Else
    'Text1.Text = "Connected"
End If


Debug.Print oAcct.RootFolder.Name
Set oFolders = oAcct.AllFolders
Cnt = 0
For Each oFolder In oFolders
    If oFolder.Name = "BLISSPrint" Then
     Debug.Print oFolder.Name
        Set oMessages = oFolder.Messages
        For Each oMessage In oMessages
       
        Debug.Print oMessage.Subject
           For Each oAttach In oMessage.Attachments
              Debug.Print oAttach.FileName
           Next
        Next
   
 
    End If
Next


Set oApp = Nothing
Set oAcct = Nothing
Set oFolders = Nothing
Set oFolder = Nothing
Set oMessages = Nothing
Set oMessage = Nothing
Set oAttach = Nothing


End Sub
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10767151
Looks OK to me, did you try to reinstall Office and/or apply the ServiceReleases ?

Nic;o)
0
 
LVL 34

Author Comment

by:flavo
ID: 10769639
>> reinstall Office and/or apply the ServiceReleases

Good luck getting the IT guys to do that for me..

It works on my PC, not slower ones... Tested on 4 works on 3 sometimes 2.. Id like it to be a little more stable..
0
 
LVL 34

Author Comment

by:flavo
ID: 10769682
this is what im playing with now....

Sub PrintAttachments1()

Dim oApp As Object
Dim oAcct As Object
Dim oFolders As Folders
Dim oFolder As Folder
Dim oMessages As Messages
Dim oMessage As Message
Dim oAttach As Attachment
Dim i As Integer

Set oApp = CreateObject("NovellGroupWareSession")
Set oAcct = oApp.Login("", "")

i = 0

Set oFolders = oAcct.Cabinet.AllFolders

'loop over folders until we get the BLISSPrint area
For Each oFolder In oFolders
    If oFolder.Name = "BLISSPrint" Then
        Set oMessages = oFolder.Messages
        'loop over all the msg's in there
        For Each oMessage In oMessages
          'if its got an attachment (from Subject) then we want the file
          If oMessage.Subject = "BLISS ATTACHMENT" Then
             'loop over the attachments to get the ones we want
             For Each oAttach In oMessage.Attachments
              If oAttach.FileName = "bliss.csv" Then
                'save them in a temp area so we can import them to Excel / Access later - delete them
                oAttach.Save "C:\Documents and Settings\" & UserName & "\BLISS" & i & ".txt"
                'open
                Workbooks.OpenText FileName:="C:\Documents and Settings\" & UserName & "\BLISS" & i & ".txt", _
                Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
                Array(Array(0, 9), Array(1, 1), Array(18, 1), Array(26, 1), Array(33, 1), Array(40, 1), _
                Array(47, 1), Array(54, 1), Array(61, 1), Array(68, 1), Array(77, 1))
                DoEvents
               
                i = i + 1
             End If
             'oMessage.Delete
             Next
           
          End If
         
        Next
       
     End If
Next

'clean up
Set oApp = Nothing
Set oAcct = Nothing
Set oFolders = Nothing
Set oFolder = Nothing
Set oMessages = Nothing
Set oMessage = Nothing
Set oAttach = Nothing

End Sub

0
 
LVL 54

Expert Comment

by:nico5038
ID: 10769742
Is this indeed more stable ?
I see you've added the DoEvents and that does indeed sometimes solve some nasty ones !

Nic;o)
0
 
LVL 34

Author Comment

by:flavo
ID: 10769797
I was playing around with them, jamming them in, adding pauses, trying anything!!

I cut down on the number of folders to fly through, that maybe helped...

Just tested on the machine i was having probs with yesterday, and it seemed to work, as long as there aren't too many files in there..

Think it may be getting stuck on saving / opening to many things at once...  Opening it in Excel helped some how... So maybe thats what it was???

I ment to take to code home and compile it to an exe in VB 6, hoping it may be more stable then Excel or Access, but forgot :-(..
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10769883
The pauses between saving/opening might indeed help, perhaps you could add a pause loop based on the file size.

Nic;o)
0
 
LVL 34

Author Comment

by:flavo
ID: 10769909
They're always 5k...

Just tested un commenting the oAttach.Delete and it seemed to work for 26 files, just going to test 30+ and see what happens (should only be about 10 anyway..)

Yep!  Worked for 40 files at a time... Ill do a test on the old laptop and see how we go..

Fingers crossed...
0
 
LVL 34

Author Comment

by:flavo
ID: 10769930
Works!
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10770040
What about storing it first in an Access table to speed up the process ?

Nic;o)
0
 
LVL 34

Author Comment

by:flavo
ID: 10770084
Its fast, takes about 5secs to do 40 files... Good enough for me :-)

Its going to be used in Excel anyway, no one else can use Access..
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question