I require some work done - eMail Merge Feature

I require some work done - eMail Merge Feature

Postby Ollie » Tue Jul 15, 2008 8:55 am

Hi guys,

I have written a small database application with FWH and xHarbour. Its a basic CRM and quoting system.

I need to add the functionaliy to be able to send bulk emails to the database by merging certain datafields.

i.e. Dear <<title>> <<surname>> etc.

Where I need the help is the editor - I would like the user to be able to create the email within the program. (Change fonts, insert pics etc.)

Naturally, I am prepared to pay for the feature or the components that can enable the feature to be added into my program.

You can contact me on: ollie @ theoasis.co.za
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am


Postby Ollie » Tue Jul 15, 2008 10:41 am

I'm sure I could. Could it still be done within the confines of my program?

OLE etc?

I need more guidance on this. Sample code etc. If I had the time, I could possibly figure it out, but I need a solution quickly.

Could you elaborate on the solution you suggest?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Enrico Maria Giordano » Tue Jul 15, 2008 11:58 am

This is a working sample:

Code: Select all  Expand view  RUN
FUNCTION MAIN()

    LOCAL oWord := CREATEOBJECT( "Word.Application" )

    LOCAL oDoc := oWord:Documents:Add()

    LOCAL oSel

    oDoc:Range:InsertAfter( "<toreplace>" + CHR( 13 ) )

    oDoc:Select()

    oSel = oWord:Selection

    WORDREPLACE( oSel, "<toreplace>", "Giordano Enrico Maria" )

    oWord:Visible = .T.

    RETURN NIL


FUNCTION WORDREPLACE( oSel, cSrc, cRpl )

    oSel:Start = 0
    oSel:End = -1

    oSel:Find:Execute( cSrc )

    oSel:Range:Text = cRpl

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Ollie » Tue Jul 15, 2008 12:15 pm

Wow! Thats was easy!

Where can I find other commands to:

1. Open an exisiting document to do the replace on.

Thanks so far!
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Enrico Maria Giordano » Tue Jul 15, 2008 12:36 pm

Search you hard disk or the Office CD for vba*.chm.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Horizon » Wed Jul 16, 2008 8:43 am

Hi Enrico,

is it possible to give an easy example that opens a word document and print it.

Thanks,
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Postby Enrico Maria Giordano » Wed Jul 16, 2008 11:13 am

Code: Select all  Expand view  RUN
FUNCTION MAIN()

    LOCAL oWord := CREATEOBJECT( "Word.Application" )

    LOCAL oDoc := oWord:Documents:Open( "E:\XHARBOUR\TEST.DOC" )

    oDoc:PrintOut( .F. )

    oDoc:Close( 0 )

    oWord:Quit()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Horizon » Wed Jul 16, 2008 11:35 am

Thanks Enrico,

It works very well.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Postby Ollie » Wed Jul 16, 2008 11:42 am

Thank you. This is all very helpful.

1. How would you do a Email merge though? Surely not with Word?

2. And on the subject of merging with Word, how would you get it to replicate the document for each record in the Database

e.g. Dear Mr Jones
Bla Bla
----- New Page -----
Dear Mr Smith
Bla Bla
----- New Page -----
etc.
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Enrico Maria Giordano » Wed Jul 16, 2008 12:01 pm

Ollie wrote:2. And on the subject of merging with Word, how would you get it to replicate the document for each record in the Database


Use InsertFile() method.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Ollie » Wed Jul 16, 2008 1:30 pm

You are a man of few words. :)

Is your response related to the Email part of my question or my "replicate" letter part of the email?

You are clearly knowledgable on the subject, and I clearly need a little more guidance. I appreciate that a forum such as this one is there to help each other on a community basis, but I need more specific help / code and am prepared to pay for your time.

As I've said I need to 1. Create an email template and 2. Send an email to the database using this template. (Using Office together with my software to achieve this is fine)

If you can help, please email me on ollie @ theoasis.co.za or on Skype Chat - ollieoasis

Thanks.
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Enrico Maria Giordano » Wed Jul 16, 2008 3:21 pm

Ollie wrote:You are a man of few words. :)


Yes, always. :-)

Ollie wrote:Is your response related to the Email part of my question or my "replicate" letter part of the email?


It is the answer to your point 2, as you can see in my quoting inside my previous message.

Ollie wrote:As I've said I need to 1. Create an email template and 2. Send an email to the database using this template. (Using Office together with my software to achieve this is fine)


Sorry, I don't know how to send emails from Word.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Ollie » Wed Jul 16, 2008 3:27 pm

It doesn't have to be from word. Is there another way to do it? I need the user to be able to design an email (nothing too fancy - basic functionality as in an Outlook express etc.) and then have that email sent to the database.

So I guess its an HTML Editor that I need that can plug in neatly into my app. Or is there a better way?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Enrico Maria Giordano » Wed Jul 16, 2008 3:33 pm

I don't know, sorry.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 94 guests