#1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ntfirewall ntfirewall is offline
external usenet poster
 
Posts: 1
Default Binary data


Hi
Here is what I am trying,
I upload a word.doc, read using fileinputstream and store the read
buffer into the table where i have a field called letterDoc of type
binary.
When I do a ms word mail merge, i can see all the other merge fields
but the binary one is blank? any ideas how to display this binary
field. or any other method that I could use to display the doc in the
mail merge

thank you


--
ntfirewall
------------------------------------------------------------------------
ntfirewall's Profile: http://www.officehelp.in/member.php?userid=6076
View this thread: http://www.officehelp.in/showthread.php?t=1320826

Posted from - http://www.officehelp.in

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Binary data

Your description isn't very clear, but can we assume that what you are
hoping for is that when you merge,

{ MERGEFIELD letterDoc }

will result in your "uploaded" document being inserted?

If it isn't, can you spell things out?

If it is,
a. It won't work that way. Mergefield fields can only be used to include
text, numeric and date data (in essence), not binary info. such as images,
persisted objects and so on.
b. To include images/.doc and other text files using fields during a merge,
the thing you want to include has to be in a file in the file system (and it
may need to be local or accessible via Windows networking, not any old
Internet URL), then you have to use a nested INCLUDEPICTURE field (for
images) or INCLUDETEXT field (for documents), so e.g. if you store the full
pathname of the object in letterDocPath you can use

{ INCLUDETEXT "{ MERGEFIELD letterDocPath }" }

As long as the text converter allows it, you can include part of the
document by using a "subset" name - in the case of Word documents, that
means a bookmark name, e.g.

{ INCLUDETEXT "{ MERGEFIELD letterDocPath }" mybookmark }
c. So either you
- store your documents in an accessible file system and a reference to them
in your data source, and use the above technique or
- extract the documents before you merge and insert the relevant pathnames
into your data source, and use the above technique or
- extract the documents during the merge and insert the relevant pathnames
into your data source, and use the above technique - e.g. you might be able
to do that in Access using a user-defined function and a query that
references it, or in SQL Server using a SQL Transact function. But I'm not
sure that either is a particularly way of going about things.

Alternatively, you can try to use Word's MailMerge events and VBA code to
extract the documents and insert them, or use a "one merge per data source
record" approach to do much the same - you'll find sample code for something
like that in a recent message written by me.

Peter Jamieson

"ntfirewall" wrote in message
...

Hi
Here is what I am trying,
I upload a word.doc, read using fileinputstream and store the read
buffer into the table where i have a field called letterDoc of type
binary.
When I do a ms word mail merge, i can see all the other merge fields
but the binary one is blank? any ideas how to display this binary
field. or any other method that I could use to display the doc in the
mail merge

thank you


--
ntfirewall
------------------------------------------------------------------------
ntfirewall's Profile: http://www.officehelp.in/member.php?userid=6076
View this thread: http://www.officehelp.in/showthread.php?t=1320826

Posted from - http://www.officehelp.in



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ntfirewall ntfirewall is offline
external usenet poster
 
Posts: 1
Default Binary data


Thanks Peter for your reply.

i am trying this but it does not work still.

Error! Not a valid filename.
INCLUDETEXT "C:\\ChambersMcClay\\Documents\\InsRequestLetters\ \{
MERGEFIELD ErrorDocFileName }.doc"


--
ntfirewall
------------------------------------------------------------------------
ntfirewall's Profile: http://www.officehelp.in/member.php?userid=6076
View this thread: http://www.officehelp.in/showthread.php?t=1320826

Posted from - http://www.officehelp.in

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Binary data

Do you have a space before the C: ? (That's a common problem!)

What is the result of { MERGEFIELD ErrorDocFileName } ?


Peter Jamieson


"ntfirewall" wrote in message
...

Thanks Peter for your reply.

i am trying this but it does not work still.

Error! Not a valid filename.
INCLUDETEXT "C:\\ChambersMcClay\\Documents\\InsRequestLetters\ \{
MERGEFIELD ErrorDocFileName }.doc"


--
ntfirewall
------------------------------------------------------------------------
ntfirewall's Profile: http://www.officehelp.in/member.php?userid=6076
View this thread: http://www.officehelp.in/showthread.php?t=1320826

Posted from - http://www.officehelp.in



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove the leading zero from mergefield . Joergen Bondesen Mailmerge 15 December 9th 06 03:29 AM
Trying to edit data source Leslie Isaacs Mailmerge 2 October 18th 06 01:32 PM
Cannot find datasource George Microsoft Word Help 3 July 22nd 06 03:38 PM
DotNet Data Table as Mail Merge Data Source goraya Mailmerge 1 July 7th 05 09:51 AM
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 05:10 AM


All times are GMT +1. The time now is 09:55 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"