FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour VBA to FW
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
VBA to FW
Posted: Wed Aug 14, 2013 10:45 PM
Does someone know how to convert this VBA Code to FW.
Thanks in advance
Otto

Code (fw): Select all Collapse
Sub Emailsenden2()
'
' Emailsenden2 Makro
'
'
 Options.SendMailAttach = True
     ActiveWindow.EnvelopeVisible = True
     With ActiveDocument.MailEnvelope.Item
         .Subject = "Testing 123"
         .Recipients.Add "datron@aon.at"
     End With
End Sub
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: VBA to FW
Posted: Thu Aug 15, 2013 08:47 AM

Otto,

It seems to me as such code will only work from VBA, I mean: from an Office app

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: VBA to FW
Posted: Thu Aug 15, 2013 09:41 AM
Hello Antonio,
thank you.
This is my code.
Code (fw): Select all Collapse
oWord:=CREATEOBJECT("Word.Application")
oWord:Documents:Add()

oDoc := oWord:ActiveDocument
oWin := oWord:Get( "ActiveWindow" )
oWin:Set( "EnvelopeVisible", .t. )
  oDoc:MailEnvelope:Item:Subject = "Testing 123"
 //oDoc:Recipients:Add = "datxxxxron@axxxx.at"


oDoc:MailEnvelope:Subject is working but the envelop view is not opened and oDoc:Recipients:Add errors out.
Maybe a security issue or wrong Syntax.

Best regards,
Otto
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: VBA to FW
Posted: Thu Aug 15, 2013 09:49 AM
Otto,

Otto wrote:
Code (fw): Select all Collapse
//oDoc:Recipients:Add = "datxxxxron@axxxx.at"


Try

Code (fw): Select all Collapse
oDoc:MailEnvelope:Item:Recipients:Add( "datxxxxron@axxxx.at" )


EMG
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: VBA to FW
Posted: Thu Aug 15, 2013 11:35 AM

Errico,

thank you. Your code is working fine.

In the meantime I tried to execute a recorded word-makro (test) with:
oWord:Run( "test").

But also there if the debugger reaches the line with EnvelopeVisible I get an error.
Not if I start the makro from inside word. Maybe this is a security setting.

Best regards,
Otto

Continue the discussion