WMarks Absent Member.
Absent Member.
1622 views

Saving multiple items to plain text

We're in the process of convering an acquisition from Exchange to GroupWise, and we're trying to recreate a procedure that depends upon Outlook functionality.

One of the acquired managers has a VB application that automates a large part of the sales reporting from their stores. This application depends on a rule in Outlook that takes the contents of a specified folder and saves all of the items in that folder to a single plain-text file.

We're looking for a way to do this within GroupWise, either directly or via a third-party plug-in.

If saving multiple apps to a single text file isn't possible, is there a way for a VB app to see the contents of a specified GroupWise folder?

Any advice or directions would be greatly appreciated!
Labels (1)
0 Likes
1 Reply
Anonymous_User Absent Member.
Absent Member.

Re: Saving multiple items to plain text

WMarks wrote:
> We're in the process of convering an acquisition from Exchange to
> GroupWise, and we're trying to recreate a procedure that depends upon
> Outlook functionality.
>
> One of the acquired managers has a VB application that automates a
> large part of the sales reporting from their stores. This application
> depends on a rule in Outlook that takes the contents of a specified
> folder and saves all of the items in that folder to a single plain-text
> file.
>
> We're looking for a way to do this within GroupWise, either directly or
> via a third-party plug-in.
>
> If saving multiple apps to a single text file isn't possible, is there
> a way for a VB app to see the contents of a specified GroupWise folder?
>
> Any advice or directions would be greatly appreciated!
>
>

With GW you us e Object API (which VB cnan access) and iterate the
store. You could start by looking at the AllFolders collection, using
for...each and getting a reference to your folder (I assume you are
identifying by name). Then get the Messages collection of that folder
object and for..each through it. Finally you would have to to what you
want....saving as a single file both text and attachments isn't built
into GW (it might have been addded to TokenAPI for GW 8?). Instead you
bulld your own file iterating through the Message object properties and
the attachments collection.

This next bit shows you the basic idea. It doesn't save the attachments
to disk (an extra method call), and it doesn't include everything. But
it should be something to start with. This is vbscript, similar to vb


'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\
'\\ CSCRIPT me.vbs
'\\ You will need the groupwise client on your PC to run this
'\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\ Have we got all of them?
dim objGroupWise
dim objAccount
dim objArchive
dim objFolder
dim objSender
dim curAccountObject
' login to groupwise
set objGroupWise=CreateObject("NovellGroupWareSession")


' live Account object
set objAccount=objGroupWise.login("username","/@u-?","password")
if (objAccount is Nothing) then
Wscript.echo "Can't login!"
Wscript.Exit
end if

' Archive Account object
set objArchive=objAccount.getArchiveAccount()

' Spit out Owner and RootFolder info for both live and archive
set objFolder=objAccount.RootFolder
set objSender=objAccount.Owner
Wscript.Echo "ROOTFOLDER (live):"+objFolder.name
Wscript.Echo "Owner (live):"+objSender.EMailAddress+" ...
"+objSender.DisplayName
set objFolder = objArchive.RootFolder
set objSender=objArchive.Owner
Wscript.Echo "ROOTFOLDER (archive):"+objFolder.name
Wscript.Echo "Owner (archive):"+objSender.EMailAddress+" ...
"+objSender.DisplayName


dim objFolders
dim objMessages
dim objRecipients
dim objRecipient
dim r

Wscript.Echo "========End of Basic AccountInfo============="
Wscript.Echo ""

dim DoBodyText
DoBodyText = false
dim DoAttachments
DoAttachments=false
dim DoArchive
DoArchive=false

set curAccountObject=objAccount
if DoArchive then
set curAccountObject=objArchive
end if



Wscript.Echo "Begin AllFolders"

dim msgcount

msgcount = 0

set objFolders=curAccountObject.AllFolders

For Each objFolder in objFolders

WScript.echo "Folder: "+objFolder.name +" .... type= " &
objFolder.objType & vbcrlf


set objMessages=objFolder.Messages

For Each objMessage in objMessages
msgcount=msgcount+1
Wscript.echo "MESSAGE #: " & msgcount
set objSender=objMessage.Sender
set objRecipients=objMessage.Recipients
Wscript.Echo "FromText: " & vbtab & vbtab & objMessage.FromText+vbCrLf
+"Subject: " & vbtab & vbtab & ObjMessage.Subject.PlainText
Wscript.Echo "FromEMailAddress: " & vbtab & objSender.EmailAddress
+vbCRLF+"FromDisplayName: " & vbtab & objSender.DisplayName
Wscript.Echo "MessageID: " & vbtab & vbtab & objMessage.MessageID &
vbcrlf + "BoxType: " & vbtab & vbtab & objMessage.boxType & vbcrlf &
"Class: " & vbtab & vbtab & vbtab & objMessage.className

r =vbtab & vbtab
For Each objRecipient in objRecipients
r = r + objRecipient.EMailAddress & vbcrlf & vbtab & vbtab
Next 'next recipient
Wscript.Echo "To: "+r
if (DoBodyText) then
Wscript.echo "Body Text: "
Wscript.echo objMessage.bodytext.plaintext
Wscript.echo ""
end if
if (DoAttachments) then
WScript.echo "Attachments: "
dim objAttachments
set objAttachments=objMessage.attachments
for each objAttachment in objAttachments
Wscript.echo vbtab & vbtab & objAttachment.FileName
next
set objAttachments=nothing
end if

Wscript.Echo "====================="
Next 'next message




Next 'next folder

Wscript.echo "Done"
set objMessages=nothing
set objMessage=nothing
set objRecipients=nothing
set objRecipient=nothing
set curAccountObject=nothing
set objSender=nothing
set objFolder=nothing
set objArchive=nothing
set objAccount=nothing
set objGroupWise=nothing
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.