Run macro after DLL mail merge

M

Mads W.

I'm using Microsoft Business Solutions C5 (C5), a danish ERP system. The MBS
people has written a DLL file, to handle merge from C5 to Word.
It works by a Template with Bookmarks. When the merge is triggered in C5,
the dll has functions to search and merge text into the bookmarks.
But I have no possibility to check if a bookmark is filled or not. I have
the typical adress "block" in my document. In C5 I have Name, Adress1,
Adress2, City. But when for instance Adress2 is empty, my adress "block"
will have a space in it.

So is there a way that I can call a macro after the dll merge is done? It's
no good to use the Autoopen or Autonew triggers, because of the dll merge is
triggered after these to triggers.

Mads W
 
W

Word Heretic

G'day "Mads W." <mw@[REMOVE]datasign.dk>,

To oversimplify, the current command to launch the dll stuff is
something like

Public Sub SomeDamnFunctionName()
MyDLLStart
End Sub

You need to replace this with your own (stored in normal or another
global template) that reads more like

Public Sub SomeDamnFunctionName()
MyDLLStart
DoMyCustomStuff
End Sub

Public Sub DoMyCustomStuff()
'blah blah
End sub

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice
 
M

Mads W.

Thx for your answer Steve,

But I don't have the access to change either the DLL or the dll call from
the C5 program.
So I need my code to be written in the template, and I need it to be
automatically triggered when the DLL merge is finished, or when the bookmark
is filled.

Mads W.


Word Heretic said:
G'day "Mads W." <mw@[REMOVE]datasign.dk>,

To oversimplify, the current command to launch the dll stuff is
something like

Public Sub SomeDamnFunctionName()
MyDLLStart
End Sub

You need to replace this with your own (stored in normal or another
global template) that reads more like

Public Sub SomeDamnFunctionName()
MyDLLStart
DoMyCustomStuff
End Sub

Public Sub DoMyCustomStuff()
'blah blah
End sub

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Mads W. said:
I'm using Microsoft Business Solutions C5 (C5), a danish ERP system. The
MBS
people has written a DLL file, to handle merge from C5 to Word.
It works by a Template with Bookmarks. When the merge is triggered in C5,
the dll has functions to search and merge text into the bookmarks.
But I have no possibility to check if a bookmark is filled or not. I have
the typical adress "block" in my document. In C5 I have Name, Adress1,
Adress2, City. But when for instance Adress2 is empty, my adress "block"
will have a space in it.

So is there a way that I can call a macro after the dll merge is done?
It's
no good to use the Autoopen or Autonew triggers, because of the dll merge
is
triggered after these to triggers.

Mads W
 
W

Word Heretic

G'day "Mads W." <mw@[REMOVE]datasign.dk>,

Ensure the DLL is referenced from a VBA project and you can then use
the object explorer (f2) to search its public functions.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Mads W. said:
Thx for your answer Steve,

But I don't have the access to change either the DLL or the dll call from
the C5 program.
So I need my code to be written in the template, and I need it to be
automatically triggered when the DLL merge is finished, or when the bookmark
is filled.

Mads W.


Word Heretic said:
G'day "Mads W." <mw@[REMOVE]datasign.dk>,

To oversimplify, the current command to launch the dll stuff is
something like

Public Sub SomeDamnFunctionName()
MyDLLStart
End Sub

You need to replace this with your own (stored in normal or another
global template) that reads more like

Public Sub SomeDamnFunctionName()
MyDLLStart
DoMyCustomStuff
End Sub

Public Sub DoMyCustomStuff()
'blah blah
End sub

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Mads W. said:
I'm using Microsoft Business Solutions C5 (C5), a danish ERP system. The
MBS
people has written a DLL file, to handle merge from C5 to Word.
It works by a Template with Bookmarks. When the merge is triggered in C5,
the dll has functions to search and merge text into the bookmarks.
But I have no possibility to check if a bookmark is filled or not. I have
the typical adress "block" in my document. In C5 I have Name, Adress1,
Adress2, City. But when for instance Adress2 is empty, my adress "block"
will have a space in it.

So is there a way that I can call a macro after the dll merge is done?
It's
no good to use the Autoopen or Autonew triggers, because of the dll merge
is
triggered after these to triggers.

Mads W
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top