You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2013/12/09 05:18:19 UTC

[Bug 123816] New: Cannot send email with attachment via VBA code taking Notes as mail application

https://issues.apache.org/ooo/show_bug.cgi?id=123816

            Bug ID: 123816
        Issue Type: DEFECT
           Summary: Cannot send email with attachment via VBA code taking
                    Notes as mail application
           Product: App Dev
           Version: 4.1.0-dev
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: critical
          Priority: P2
         Component: vba
          Assignee: issues@openoffice.apache.org
          Reporter: fanyuzhen@gmail.com
                CC: clarence.guo.bj@gmail.com,
                    issues@openoffice.apache.org, liushenf@gmail.com

Steps:
1. Copy the following VBA code in AOO Calc(please note to change the notes mail
db "C:\notes\Data\guoyanp.nsf", send to notes id "guoyanp@cn.ibm.com" and
config file "d:\config.txt" correspondingly to your test data), please refer
the sample in Attachment
2. Run the VBA code

Expected result: email with attachment is sent out

Actual result: cannot send the email with attachment with error message.

Notes: email with no attachment can be sent out 


REM  *****  BASIC  *****

Sub Main
Dim db As Object
Dim MailDoc As Object
Dim AttachME As Object 'The attachment richtextfile object
Dim EmbedObj As Object 'The embedded object (Attachment)

Set Session = CreateObject("Lotus.NotesSession")

Call Session.Initialize
Set db = Session.GETDATABASE("", "C:\notes\Data\guoyanp.nsf")

'Open DB
If db.IsOpen = False Then db.OPENMAIL 

Set MailDoc = db.CREATEDOCUMENT

With MailDoc
Call .ReplaceItemValue("Form", "Memo") 
Call .ReplaceItemValue("SendTo", "guoyanp@cn.ibm.com") 
Call .ReplaceItemValue("CopyTo", "") 

Call .ReplaceItemValue("Subject", "Hello") 

Set Body = .CREATERICHTEXTITEM("Body") 
Call Body.APPENDTEXT("How are you") 


.SaveMessageOnSend = True
Set AttachME = .CREATERICHTEXTITEM("Attachment")

'************** This statement fails here ********************
'Commented since its not working but works in MS Excel VBA
'Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", sAttachment, "Attachment") '1454
= Constant for EMBED_ATTACHMENT


'OpenOffice Starbasic equivalent code for above statement
Call AttachME.EmbedObject(1454, "", "d:\config.txt") '1454 = Constant for
EMBED_ATTACHMENT

'************** End of statement fails ******************** 


.ReplaceItemValue("PostedDate","2013/1/1")
.send (False)

End With 

Set MailDoc = Nothing

End Sub

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

[Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=123816

fanyuzhen@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED

--- Comment #5 from fanyuzhen@gmail.com ---
It's verified fixed in AOO410m1(Build:9750)  -  Rev. 1566593

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.

[Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=123816

Oliver-Rainer Wittmann <or...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.0

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.

[Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=123816

fanyuzhen@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|issues@openoffice.apache.or |clarence.guo.bj@gmail.com
                   |g                           |

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

review requested: [Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application : [Attachment 82057] fix patch

Posted by bu...@apache.org.
Clarence GUO <cl...@gmail.com> has asked  for review:
Bug 123816: Cannot send email with attachment via VBA code taking Notes as mail
application
https://issues.apache.org/ooo/show_bug.cgi?id=123816

Attachment 82057: fix patch
https://issues.apache.org/ooo/attachment.cgi?id=82057&action=edit


------- Additional Comments from Clarence GUO <cl...@gmail.com>
Root Cause:
Currently, COM codes does not support the parameter which type is TYPE_ALIAS.
But for some methods, e.g., Notes COM component uses TYPE_ALIAS for attachment.


Resolution:
Check if the type is TYPE_ALIAS, then get the alias type of this parameter.

[Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=123816

Clarence GUO <cl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #82057|                            |review?
              Flags|                            |

--- Comment #2 from Clarence GUO <cl...@gmail.com> ---
Created attachment 82057
  --> https://issues.apache.org/ooo/attachment.cgi?id=82057&action=edit
fix patch

Root Cause:
Currently, COM codes does not support the parameter which type is TYPE_ALIAS.
But for some methods, e.g., Notes COM component uses TYPE_ALIAS for attachment.

Resolution:
Check if the type is TYPE_ALIAS, then get the alias type of this parameter.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.

[Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=123816

--- Comment #3 from SVN Robot <sv...@dev.null.org> ---
"steve_y" committed SVN revision 1549481 into trunk:
Bug 123816 - Cannot send email with attachment via VBA code taking Notes as
m...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.

[Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=123816

--- Comment #1 from fanyuzhen@gmail.com ---
Created attachment 82056
  --> https://issues.apache.org/ooo/attachment.cgi?id=82056&action=edit
Sample with VBA code

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

[Bug 123816] Cannot send email with attachment via VBA code taking Notes as mail application

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=123816

Steve Yin <st...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
                 CC|                            |steve.yin.aoo@gmail.com
         Resolution|---                         |FIXED

--- Comment #4 from Steve Yin <st...@gmail.com> ---
Committed the patch from Clarence.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.