Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
christopher.allen christopher.allen is offline
external usenet poster
 
Posts: 2
Default detach header source?

In Word 2000/2003 VBA, I'm processing mail merge docs that may or may
not have header and data sources already attached. I'm attaching other
data sources that contain their own header info, so I want to remove any
already-attached header source.

Is there a way to do this? Calling OpenHeaderSource with "" gives a
runtime error. Can't set HeaderSourceName as it's read-only. Thanks!

-Christopher
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default detach header source?

Try setting .MainDocumentType to wdNotAMergeDocument (of course you lose
all the data source connection info. but it looks as if you are doing that
anyway).

--
Peter Jamieson
http://tips.pjmsn.me.uk

"christopher.allen" "at workscape.com" wrote in message
...
In Word 2000/2003 VBA, I'm processing mail merge docs that may or may not
have header and data sources already attached. I'm attaching other data
sources that contain their own header info, so I want to remove any
already-attached header source.

Is there a way to do this? Calling OpenHeaderSource with "" gives a
runtime error. Can't set HeaderSourceName as it's read-only. Thanks!

-Christopher


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
christopher.allen christopher.allen is offline
external usenet poster
 
Posts: 2
Default detach header source?

Based on your tip (thanks!) I looked at the online doc for
MainDocumentType, which says this:

"If you set this property for a document that's already a main document,
the attached data source is removed."

It doesn't specify what to set it to. Since my code already sets it to
wdFormLetters after opening, I verified that this really removes the
data source, plus it also removes the header source.

-Chris

Peter Jamieson wrote:
Try setting .MainDocumentType to wdNotAMergeDocument (of course you
lose all the data source connection info. but it looks as if you are
doing that anyway).

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
Mail Merge With Seperate Source and Header files kclark Mailmerge 4 April 2nd 07 03:08 PM
How to detach a photo from Word and send to my pictures swaviator Microsoft Word Help 2 February 27th 07 08:07 PM
Detach or change SQL data source for Word template, and other Qs SJMac Mailmerge 6 July 27th 06 10:12 AM
How to link a different Mailmerge header source and data source? Eleni_Malli Mailmerge 1 May 3rd 06 02:08 PM
Mail Merge with separate Source Header document KM Wagner Mailmerge 1 May 25th 05 10:23 AM


All times are GMT +1. The time now is 03:24 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"