PDA

View Full Version : Groupwise-Mail and paste from clipboard



derkleinemas
11-28-2006, 01:17 PM
Ho,ho,ho from Germany....:beerchug:

hope you are be aible to help me to fill up these code..I want to sent a Groupwisemail by an eventhandler on a Data page..but into the body i want to paste from clipboard..

First i call a access function to do a screenshot by an keyevent...

Set objAc = CreateObject ("Access.Application")
objAc.OpenCurrentDatabase"C:\Dokumente und Einstellungen\Alle\Desktop\db5_Backup.mdb"
objAc.Visible = false
'clip takes a screenshot from active window
objAc.Application.Run "clip"
objAc.Application.CloseCurrentDatabase
objAc.Application.Quit
Set wshshell=Nothing
Set objAc=Nothing
Now Groupwise...
Dim x, b
Dim Mldg, Stil, Titel, Hilfe, Ktxt, Antwort, Text1
Dim sFile
Dim objGroupWise
Dim objAccount
Dim objMessages
Dim objMessage
Dim objMailBox
Dim objRecipients
Dim objRecipient

Dim objMessageSent
Dim Subject, Recipient , Bodytext
x = Beratermail.value'Recipient
Subject = "Neue Terminvereinbarung!!"
Recipient = x
Bodytext = b' any idea to get data from clipboard into body?
Set objGroupWise = CreateObject("NovellGroupWareSession")
Set objAccount = objGroupWise.Login
Set objMailBox = objAccount.MailBox
Set objMessages = objMailBox.Messages
Set objMessage = objMessages.Add("GW.MESSAGE.MAIL", "Draft")
Set objRecipients = objMessage.Recipients
Set objRecipient = objRecipients.Add(Recipient)

With objMessage
.Subject = Subject
.Bodytext=Bodytext' Clipboard...:banghead:......

End With
Set objMessageSent = objMessage.Send
Set objGroupWise = Nothing
Set objAccount = Nothing
Set objMailBox = Nothing
Set objMessages = Nothing
Set objMessage = Nothing
Set objRecipients = Nothing
Set objAttachments = Nothing
Set objRecipient = Nothing
Set objAttachment = Nothing
Set objOleAttachPaste = Nothing ' ' ' ' ' -->
....any idea?

regards from Germany....

Ken Puls
11-28-2006, 02:23 PM
Hi there,

FYI, I edited your post to use our VBA tags to make it more readable. (Check the green VBA button on the reply toolbar.)

First thing I see is this:
objAc.Application.Run "clip"

Can you post the details of the "clip" routine from Access? This tells us how the data is being pushed to the clipboard.

derkleinemas
11-28-2006, 02:33 PM
Option Compare Database
Private Declare Sub keybd_event _
Lib "user32" ( _
ByVal byteVirtualKeycode As Byte, _
ByVal byteScan As Byte, _
ByVal lFlags As Long, _
ByVal lExtraInfo As Long)

Private Const KEYEVENTF_KEYUP As Long = &H2 ' Taste l?sen
Private Const VK_MENU As Byte = &H12 ' Alt-Taste
Private Const VK_SNAPSHOT As Byte = &H2C ' Druck/PrtScrn-Taste
Declare Function CloseClipboard Lib "user32" () As Long
Declare Function EmptyClipboard Lib "user32" () As Long
Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long

Function clip()
Call ScreenCopy
End Function

Public Sub ScreenCopy(Optional ByVal ActiveWindow As Boolean = False)
' ?bertr?gt eine Bildschirmkopie des Desktops (ActiveWindow = False)
' oder des aktiven Fensters (ActiveWindow = True) in die Zwischenablage.

If ActiveWindow Then

' Nur das aktive Fenster abfotografieren
' => Alt-Taste einbeziehen
keybd_event VK_MENU, 0, 0, 0 ' Alt 'runter
keybd_event VK_SNAPSHOT, 0, 0, 0 ' Druck ' runter
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0 ' Druck hoch
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0 ' Alt hoch

Else

' Den gesamten Desktop abfotografieren
keybd_event VK_SNAPSHOT, 0, 0, 0 ' Druck ' runter
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0 ' Druck hoch

End If

End Sub

Ken Puls
11-28-2006, 03:11 PM
Hi there,

Maybe this will help: http://www.catenary.com/howto/clipbrd.html

It seems to have a method for both copying to/from the clipboard using VB.

Let us know,

derkleinemas
11-29-2006, 02:04 PM
thanks for the link......

my problem is not how to copy into clipboard and paste from it,

i need a Groupwise command or something to paste the screenshot from clipboard to the body of the Mail ....and it has to work around the VB Script Environment.

Hope of help.....: pray2: