Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Please see the code below. I am trying to automate a system to push multiple qlickview objects into outlook. The issue I am encountering is that when you use the default paste the images resolution goes crazy. I believe the solution is to use pastespecial but I can't get the code right in this line :-
myDoc.Range(0,0).PasteSpecial Placement:=wdInLine, DataType:=wdPasteBitmap
Has anyone got any experience of this or can offer any advice?
Many Thanks
Sub SendMail
Set myApp = CreateObject ("Outlook.Application")
Set myMessage = myApp.CreateItem(olMailItem)
myMessage.BodyFormat = 2 'HTMLFormat
myMessage.To = "XXXXXX@XXXXXXXXXX.com"
myMessage.Subject = "Qlikview Automated Email Testing"
Set myInspector = myMessage.GetInspector 'this inserts signature to e-mail
Set myDoc = myInspector.WordEditor
Set ol
myInspector.WordEditor.Content.InsertBefore chr(13)
myInspector.WordEditor.Content.InsertBefore chr(13)
ActiveDocument.GetSheetObject("TB02").CopyTableToClipboard TRUE
myDoc.Range(1,1).Paste
myInspector.WordEditor.Content.InsertAfter chr(13)
myInspector.WordEditor.Content.InsertBefore chr(13)
myInspector.WordEditor.Content.InsertBefore chr(13)
ActiveDocument.GetSheetObject("CH02").CopyBitmapToClipboard
myDoc.Range(0,0).PasteSpecial Placement:=wdInLine, DataType:=wdPasteBitmap
myInspector.WordEditor.Content.InsertBefore chr(13)
myInspector.WordEditor.Content.InsertBefore chr(13)
myInspector.WordEditor.Content.InsertBefore "Dear Colleagues, " & chr(13) & chr(13) & "MESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGE"
myMessage.Display
Set myMessage = Nothing
Set myApp = Nothing
Set myInspector = Nothing
Set myDoc = Nothing
end sub
This always happens to me. I find the answer 10 minutes after giving up and asking a forum..
Anyways I changed the line to "myDoc.Range(0,0).PasteSpecial False, False, 0, False, 5 "
and you can find more info here on why it should be like that -
http://msdn.microsoft.com/en-us/library/office/bb241758(v=office.12).aspx
This always happens to me. I find the answer 10 minutes after giving up and asking a forum..
Anyways I changed the line to "myDoc.Range(0,0).PasteSpecial False, False, 0, False, 5 "
and you can find more info here on why it should be like that -
http://msdn.microsoft.com/en-us/library/office/bb241758(v=office.12).aspx