Good Evening!,
I am an VBA newbie and need some help.
I am writing a small script that should help me. Now i have some trouble with sending an email via IBM Notes.
My script opens a word doc. and copy the whole document to the clipboard. After that it opens an new Notes Mail Document and paste the copied thing. That Word docment has tables. After pasting the clipboard everything looks good. But if you receive the Email the lines of the vertical tables ann other frames are lost.
If I open a new IBM notes mail manually and paste the clippboard by pressing Strg+V and send them everything is fine. I get an email with the wright tables. So it seems that the clipboard has copied the whole tables.
In this case it have to be a problem with notes document opening procedure.
With this code the Notes Email has to be open - otherwise it won´t work. Is it possible to check if it allready oppen and otherwise it will open an new instance and document?... But thats not the main problem... first i have to fix the bad tables thing and then i will see.
I note shure if the first lines the right ones beacause I made a picture of the code during my work and now it is evening and i am at home and have to write it down form the picture. The first lines were cut of... I try to reconstruct them but it could be wrong.
Here is a picture how the table looks in the received email - A lot of table frames were lost.
I am an VBA newbie and need some help.
I am writing a small script that should help me. Now i have some trouble with sending an email via IBM Notes.
My script opens a word doc. and copy the whole document to the clipboard. After that it opens an new Notes Mail Document and paste the copied thing. That Word docment has tables. After pasting the clipboard everything looks good. But if you receive the Email the lines of the vertical tables ann other frames are lost.
If I open a new IBM notes mail manually and paste the clippboard by pressing Strg+V and send them everything is fine. I get an email with the wright tables. So it seems that the clipboard has copied the whole tables.
In this case it have to be a problem with notes document opening procedure.
With this code the Notes Email has to be open - otherwise it won´t work. Is it possible to check if it allready oppen and otherwise it will open an new instance and document?... But thats not the main problem... first i have to fix the bad tables thing and then i will see.
I note shure if the first lines the right ones beacause I made a picture of the code during my work and now it is evening and i am at home and have to write it down form the picture. The first lines were cut of... I try to reconstruct them but it could be wrong.
Here is a picture how the table looks in the received email - A lot of table frames were lost.
VBA Code:
Public Sub COPY_PASTE_CLIPPBOARD_NOTES_EMAIL ()
Dim NUIWorkSpace As Object
Dim NUIDocument As Object
Dim wdApp as Word.Application
Dim wdDoc as Word.Document
Dim wdRage as Word.Range
set wdApp = CreateObject ("Word.Application")
with wdapp
Set wdDoc = .Documents.add ("U:\XYZ\wordfile.docx")
. Visible = true
End With
Set wdRange = wdDoc.Range
wdRange.WholeStory
wdRange.Copy
With ActiveSheet
ToEmail = "xyz@mail.com"
CCEmail = ""
BCCEmail = ""
Subject ="xyz"
End With
Set NUIWorkspace = CreateObject ("Notes.NotesUIWorkspace"]
'Create an email using the Notes UI
NUIWorkspace.ComposeDocument , , "Memo"
Do
Set NUIDocument = NUIWorkspace.CurrentDocument
DoEvents
Loop While NUIDocument is Nothing
With NUIDocument
.FieldSetText "EnterSendTo", ToEmail
.FieldSetText "EnterCopyTo", CCMail
.FieldSetText "EnterBlindCopyTo", BCCEmail
.FieldSetText "Subject", Subject
.GoToField "Body"
.Paste
Application.CutCopyMode= False
'.Send
'.Close
End With
Set NUIWorkspace=Nothing
Set NUIDocument =Nothing
wdApp.Quit SaveChanges:=False
Set wdApp = Nothing
Set wdDoc = Nothing
Set wdRange = Nothin