Consulting

Results 1 to 5 of 5

Thread: Groupwise-Mail and paste from clipboard

  1. #1

    Groupwise-Mail and paste from clipboard

    Ho,ho,ho from Germany....

    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...

    [vba]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[/vba]
    Now Groupwise...
    [vba]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.........

    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 ' ' ' ' ' -->[/vba]
    ....any idea?

    regards from Germany....

  2. #2
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    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:
    [vba]objAc.Application.Run "clip"[/vba]

    Can you post the details of the "clip" routine from Access? This tells us how the data is being pushed to the clipboard.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  3. #3
    [VBA]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[/VBA]

  4. #4
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    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,
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  5. #5

    Groupwise Command

    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.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •