Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Randy
 
Posts: n/a
Default Data Source Location Change

I have a word merge (word 2002) linked to an excel file (data source) with a
macro. I need to change the location of the data source. When I do this some
of the formatting changes in the merge doc. For example; several field in the
data source are currency formated to two decimal places. Works great as long
as I do not change the data source location. Once I change the data source
location the formatting on the merge doc changes to no decimals.

Any ideas as to why this may be happening? Any assistance will be greatly
appreaciated. I thank you in advance for help or ideas you may be able to
provide.
--
Randy Street
Rancho Cucamonga, CA
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Data Source Location Change

Can you provide the macro code you use to open the data source (assuming
that is what your macro does)? The most likely reason for this is that you
have set up a connection using one method (e.g. DDE, which would open a copy
of Excel) and your code opens using another method (probably OLEDB).

Peter Jamieson


"Randy" wrote in message
news
I have a word merge (word 2002) linked to an excel file (data source) with
a
macro. I need to change the location of the data source. When I do this
some
of the formatting changes in the merge doc. For example; several field in
the
data source are currency formated to two decimal places. Works great as
long
as I do not change the data source location. Once I change the data source
location the formatting on the merge doc changes to no decimals.

Any ideas as to why this may be happening? Any assistance will be greatly
appreaciated. I thank you in advance for help or ideas you may be able to
provide.
--
Randy Street
Rancho Cucamonga, CA


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Randy
 
Posts: n/a
Default Data Source Location Change

Here is the macro code that actually opens the merge doc...

Sub MyMacro()
Documents.Open FileName:="S:\Yardi45\3 Day Merge.doc"
With Documents("3 Day Merge.doc").MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
Documents("3 Day Merge.doc").Close _
SaveChanges:=wdDoNotSaveChanges
End Sub

--
Randy Street
Rancho Cucamonga, CA


"Peter Jamieson" wrote:

Can you provide the macro code you use to open the data source (assuming
that is what your macro does)? The most likely reason for this is that you
have set up a connection using one method (e.g. DDE, which would open a copy
of Excel) and your code opens using another method (probably OLEDB).

Peter Jamieson


"Randy" wrote in message
news
I have a word merge (word 2002) linked to an excel file (data source) with
a
macro. I need to change the location of the data source. When I do this
some
of the formatting changes in the merge doc. For example; several field in
the
data source are currency formated to two decimal places. Works great as
long
as I do not change the data source location. Once I change the data source
location the formatting on the merge doc changes to no decimals.

Any ideas as to why this may be happening? Any assistance will be greatly
appreaciated. I thank you in advance for help or ideas you may be able to
provide.
--
Randy Street
Rancho Cucamonga, CA




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Randy
 
Posts: n/a
Default Data Source Location Change


--
Randy Street
Rancho Cucamonga, CA


"Peter Jamieson" wrote:

Can you provide the macro code you use to open the data source (assuming
that is what your macro does)? The most likely reason for this is that you
have set up a connection using one method (e.g. DDE, which would open a copy
of Excel) and your code opens using another method (probably OLEDB).

Peter Jamieson


"Randy" wrote in message
news
I have a word merge (word 2002) linked to an excel file (data source) with
a
macro. I need to change the location of the data source. When I do this
some
of the formatting changes in the merge doc. For example; several field in
the
data source are currency formated to two decimal places. Works great as
long
as I do not change the data source location. Once I change the data source
location the formatting on the merge doc changes to no decimals.

Any ideas as to why this may be happening? Any assistance will be greatly
appreaciated. I thank you in advance for help or ideas you may be able to
provide.
--
Randy Street
Rancho Cucamonga, CA



Ooops...I don't think I provided you what you were asking...let me get back to you on that one...

Is there another way to link to an excel spreadsheet other than the merge
wizard?
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Data Source Location Change

You can use Word VBA's OpenDataSource method. The connection will be made
using DDE, OLEDB, or ODBC depending on the parameters you provide. Beyond
that, I've run out of time for now so maybe you could use Google Groups to
search this group for examples, e.g. using "Jamieson OpenDataSource xls" or
some such.

Peter Jamieson

"Randy" wrote in message
...

--
Randy Street
Rancho Cucamonga, CA


"Peter Jamieson" wrote:

Can you provide the macro code you use to open the data source (assuming
that is what your macro does)? The most likely reason for this is that
you
have set up a connection using one method (e.g. DDE, which would open a
copy
of Excel) and your code opens using another method (probably OLEDB).

Peter Jamieson


"Randy" wrote in message
news
I have a word merge (word 2002) linked to an excel file (data source)
with
a
macro. I need to change the location of the data source. When I do this
some
of the formatting changes in the merge doc. For example; several field
in
the
data source are currency formated to two decimal places. Works great as
long
as I do not change the data source location. Once I change the data
source
location the formatting on the merge doc changes to no decimals.

Any ideas as to why this may be happening? Any assistance will be
greatly
appreaciated. I thank you in advance for help or ideas you may be able
to
provide.
--
Randy Street
Rancho Cucamonga, CA



Ooops...I don't think I provided you what you were asking...let me get
back to you on that one...


Is there another way to link to an excel spreadsheet other than the merge
wizard?


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
Word 2003 Mail Merge Problem when E-Mailing Data Source Karen Townsend Mailmerge 3 June 20th 06 08:21 AM
Data Trucated in word merge with excel source BAW Mailmerge 6 May 3rd 06 04:10 PM
Maniplulating the data source location of a merge, MS Word merge MCubitt Mailmerge 6 June 24th 05 10:33 AM
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 05:10 AM
multiple docs, one data source kp Mailmerge 12 January 31st 05 04:41 PM


All times are GMT +1. The time now is 07:43 AM.

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"