Save attachments from GroupWise

wliporace

New member
Joined
Jan 15, 2013
Messages
10
Reaction score
0
Points
0
I am a trying to save .doc and .docx files from a folder in GroupWise to a network folder. We are running GroupWise 8.0.3 with the latest patches. The article here: showthread.php?510-Article-Extract-Novell-Groupwise-Attachments-And-Save-To-A-Directory&highlight=GroupWise (sorry, would not let me post the link) explains how to do it. I also saw a couple of threads that talk about it, but guess I am missing part of the puzzle.

I only changed this:
Code:
'Change required variables here!
sLoginName = "ajannson"
sFolderToSearch = "Census"
sSavePath = "C:\Share\DOCS\Census\mail" 'do not add trailing \ sFileType = "docx"
Here is what I get:
C:\Download>attach.wsf
Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved.
C:\Download\attach.wsf(70, 2) Windows Script Host: Unterminated entity reference
- matching ';' not found

I did not change anything else in the script. I did run it from the local HD on the PC.
I am not sure what you are using for a VB editor.
I have not checked to see the Groupware Type Library checked.

Can someone shed some light on how to set this up, where to run it and etc...
TNX Will
 
Hi Will,

Do you really have the sFileType = "docx" at the end of the line? I beleive it should be:
Code:
'Change required variables here!
sLoginName = "ajannson"
sFolderToSearch = "Census"
sSavePath = "C:\Share\DOCS\Census\mail" 'do not add trailing \ 
sFileType = "docx"
 
it is actually correct...
Windows didn't paste correctly:
'Change required variables here!
sLoginName = "ajannson"
sFolderToSearch = "Census"
sSavePath = "C:\Share\DOCS\Census\mail" 'do not add trailing \
sFileType = "docx"
 
From a differnt PC, I get this information:
Script: C:\Download\attach.vbs
Line: 2
Char: 16
Error: Expected end of etatement
Code: 800A0401
Source: Microsoft VBScript compilation error

Will
 
Here you go :)

Option Explicit
Private ogwApp As GroupwareTypeLibrary.Application
Private ogwRootAcct As GroupwareTypeLibrary.Account
Sub Groupwise_SaveAttachToFile()
'Author : Ken Puls
'Macro Purpose: Save all attachments of specified file type into a
'user specified folder using Groupwise
'NOTE: Reference to Groupware Type Libary required
Dim ogwFolder As Folder, _
ogwFoundFolder As Folder, _
i As Long, _
sCommandOptions As String, _
sMailPassword As String, _
sLoginName As String, _
sFolderToSearch As String, _
sFileType As String, _
sSavePath As String, _
ogwMail As Mail
'Change required variables here!
sLoginName = "ajannson"
sFolderToSearch = "Census"
sSavePath = "C:\Download\ajansson" 'do not add trailing \
sFileType = "docx"
'Set application object reference if needed
If ogwApp Is Nothing Then 'Need to set object reference
DoEvents
Set ogwApp = CreateObject("NovellGroupWareSession")
DoEvents
End If
 
Yuck. Okay, here's the deal...

The code you've got is meant to be early bound in order to run. vbscript doesn't do that. It's going to need conversion to late binding to run.

I don't have time to do that right today, but I'll see if I can get to it tomorrow.
 
Any help would be great! I have a user with over 1000 email messages with attachments in just one folder!! She is leaving service soon!

TNX Will
 
Actually, Will, if you're in a hurry, why not just run it from Excel VBA (which is where it was designed)?

Open Excel, press Alt+F11 to get into the VBE, copy the code into a standard module, set the reference as documented in the article, make your changes and have the user run it. It'll be WAY easier than going through the hassle of converting the code....
 
I did not know how to run it in Excel.. This is new to me!!
OK, I did what I think I am suppose to do and NO joy....
This is what I have changed:
'Change required variables here!
sLoginName = "ajannson"
sFolderToSearch = "Census"
sSavePath = "C:\Download\ajansson" 'do not add trailing \
sFileType = "docx"

Set GroupWare under Tools - Preferences - Added the GroupWare option.
Pasted the script into a new module
Ran the script.

It appears to run, but nothing appears in C:\Download\ajansson.
Where does the password for ajannson get set or input? As an FYI, I was logged into GroupWise.
 
OK, I am seeing an oddity...
Same PC
My login, chose a folder and chose pdf files. Works great. I thoguht I had it.
user Login, chose folder and chose docx, does not work...
Any ideas?? more in the morning....

Will
 
OK, I have proved that it is NOT able to save DOCX file extentions. I have not tried Excel or any others. I know that DOC & PDF works. Any ideas or suggestions?

Also I have some files that are all called 07 or 09... is there a neat way to do a save as and it come out with the subject and the file extention?

Will
 
Hi Will,

Try replacing this:
Code:
If Right(.Attachments(i).Filename, 3) = sFileType Then
	.Attachments(i).Save _
	sSavePath & "\" & .Attachments(i).Filename
End If

With this:
Code:
If Right(.Attachments(i).Filename, len(sFileType)) = sFileType Then
.Attachments(i).Save _
sSavePath & "\" & .Attachments(i).Filename
End If

I think that should fix it for you.
 
Thank you!! I was able to save the docx files with no problem.

TNX Will
 
Back
Top