Hi,

I'm working on an Word offertemplate, after lots of hardworking, it's
finished! But now there's a big problem, If the template is merged with
our CRM software (called Winris, a dutch company) The macro's won't
work anymore. If you use the template manualy all the macro's work
fine, but after merging (and even saving in the same directory as the
Template)you'll get the next error message:

Run-time error '5941'
The requested member of the collection does not exist.

ONly the index-macro still works fine (not connected to any external
file).
In the template I've used macro's like:

Sub AMwest()
'
' AMwest Macro
' Macro opgenomen op 31-10-03 door Receptie
'
ChangeFileOpenDirectory _
"F:\data\Public\Offerte documenten\Gegevens Accountmanager\"
ActiveDocument.Bookmarks("ButtonAM").Select
Selection.InsertFile FileName:="amwest.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
End Sub


I'm using word2000 and VB6, we use the crm-sw to merge the customername
and adress with the offer (one at a time). And then select severel
options (by non-working macros at the moment.

I hope someone can help me with this problem since we're dealing with
it for several months by now!

Thanx in Advance

B Meijer from the Netherlands



p.s. I just found out it's caused by the bookmarks wich are gone after
merging!:confused: Any idea anybody?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

Re: run-time error '5941' after merging by Doug

Doug
Sat Jan 24 03:14:51 CST 2004

You have found the cause of your problem, the bookmarks do not appear in the
document created by the mailmerge. Why don't you include an { INCLUDETEXT }
field in you mail merge maindocument instead. If the text to be inserted is
different for each record, you can have the filename in one of the data
fields and use a mergefield inside the { INCLUDETEXT } field. The way in
which you would do this is similar to the way in which you include a picture
in a mailmerge. You can find information on doing that in the "Graphic
from database" item under the "Special merges" section of fellow MVP CIndy
Meister's website at

http://homepage.swissonline.ch/cindymeister/MergFram.htm
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
"koningh" <koningh.10iv2i@nospam.WordForums.com> wrote in message
news:koningh.10iv2i@nospam.WordForums.com...
>
> Hi,
>
> I'm working on an Word offertemplate, after lots of hardworking, it's
> finished! But now there's a big problem, If the template is merged with
> our CRM software (called Winris, a dutch company) The macro's won't
> work anymore. If you use the template manualy all the macro's work
> fine, but after merging (and even saving in the same directory as the
> Template)you'll get the next error message:
>
> Run-time error '5941'
> The requested member of the collection does not exist.
>
> ONly the index-macro still works fine (not connected to any external
> file).
> In the template I've used macro's like:
>
> Sub AMwest()
> '
> ' AMwest Macro
> ' Macro opgenomen op 31-10-03 door Receptie
> '
> ChangeFileOpenDirectory _
> "F:\data\Public\Offerte documenten\Gegevens Accountmanager\"
> ActiveDocument.Bookmarks("ButtonAM").Select
> Selection.InsertFile FileName:="amwest.doc", Range:="", _
> ConfirmConversions:=False, Link:=False, Attachment:=False
> End Sub
>
>
> I'm using word2000 and VB6, we use the crm-sw to merge the customername
> and adress with the offer (one at a time). And then select severel
> options (by non-working macros at the moment.
>
> I hope someone can help me with this problem since we're dealing with
> it for several months by now!
>
> Thanx in Advance
>
> B Meijer from the Netherlands
>
>
>
> p.s. I just found out it's caused by the bookmarks wich are gone after
> merging!:confused: Any idea anybody?
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>