#1   Report Post  
Posted to microsoft.public.word.newusers
Garry Jones
 
Posts: n/a
Default Linking error

I am linking an Excel document to Word but having trouble with the date
format.

I have a date field formatted correctly for the Swedish date standard.
When I link and create new document with the data in word the format
changes to some international standard. In Excel it is formatted
correctly. How can I maintain the correct format when linking to word.

February 4th 2006 should be correctly written in Swedish as 2006-02-04

But when linked to word it becomes "2/4/2006" which can be
misunderstood.

I am using Swedish Office 2003.

Any ideas?

Garry Jones
Sweden

  #2   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor
 
Posts: n/a
Default Linking error

*How* are you linking? Is this a mail merge or a pasted link?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Garry Jones wrote:
I am linking an Excel document to Word but having trouble with the
date format.

I have a date field formatted correctly for the Swedish date standard.
When I link and create new document with the data in word the format
changes to some international standard. In Excel it is formatted
correctly. How can I maintain the correct format when linking to word.

February 4th 2006 should be correctly written in Swedish as 2006-02-04

But when linked to word it becomes "2/4/2006" which can be
misunderstood.

I am using Swedish Office 2003.

Any ideas?

Garry Jones
Sweden



  #3   Report Post  
Posted to microsoft.public.word.newusers
Garry Jones
 
Posts: n/a
Default Linking error

Graham Mayor wrote:

*How* are you linking? Is this a mail merge or a pasted link?


Merge - Now from Access to Word... (2003)

I solved the first bit but still have problems... I know now of the \@
switch, the following code works and writes the date in the way I want.

{MERGEFIELD "Date2" \@ yyyy/MM/dd}

The following adds a - before the field if it exists, but leaves the
date in the wrong format.

{MERGEFIELD "Date2" \b " - "}

The following code "should work" but does not, how do you use the \@
switch and the \b switch simultaneously

{MERGEFIELD "Date2" \@ yyyy/MM/dd \b " - "}

Am I missing something...?

Garry Jones
Sweden
  #4   Report Post  
Posted to microsoft.public.word.newusers
Cindy M -WordMVP-
 
Posts: n/a
Default Linking error

Hi Garry,

I don't understand what you're trying to do. In your first message you
state
"February 4th 2006 should be correctly written in Swedish as 2006-02-04"

that would mean the merge field should appear:
{MERGEFIELD "Date2" \@ yyyy-MM-dd}

What are you trying to accomplish with the \b "-" ?

I know now of the \@
switch, the following code works and writes the date in the way I want.

{MERGEFIELD "Date2" \@ yyyy/MM/dd}

The following adds a - before the field if it exists, but leaves the
date in the wrong format.

{MERGEFIELD "Date2" \b " - "}

The following code "should work" but does not, how do you use the \@
switch and the \b switch simultaneously


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

  #5   Report Post  
Posted to microsoft.public.word.newusers
Garry Jones
 
Posts: n/a
Default Linking error


Cindy M -WordMVP- wrote:

Hi Garry,

I don't understand what you're trying to do. In your first message you
state
"February 4th 2006 should be correctly written in Swedish as 2006-02-04"

that would mean the merge field should appear:
{MERGEFIELD "Date2" \@ yyyy-MM-dd}

What are you trying to accomplish with the \b "-" ?


I solved the first issue and created a second problem. I need to
seperate the dates with a " - ". I have a list of events that are
generally speaking one day events. In my document I want to write "The
event takes place 2006-02-04 and is a bla bla bla"

On the odd occasion it is an event spread over several days it should
read...

"The event takes place 2006-02-04 - 2006-02-05 and is a bla bla bla. "

So I need to add a " - " if the second field exists. I can leave the
date in the standard American date format. (In that case the \b switch
works). I can turn the date into the Swedish format but then the code
ignores the b switch.)

What am I missing, how do I combine \@ and \b switches?

Thanks for your answer,,, and time.

Garry Jones
Sweden


  #6   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill
 
Posts: n/a
Default Linking error

Cindy has already told you that using the \@ yyyy-MM-dd switch will format
the date as you want it. To add extra dates you'll need to incorporate an IF
field to test for the presence of additional dates. And you haven't answered
her question about what the \b switch is supposed to do.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Garry Jones" wrote in message
...

Cindy M -WordMVP- wrote:

Hi Garry,

I don't understand what you're trying to do. In your first message you
state
"February 4th 2006 should be correctly written in Swedish as 2006-02-04"

that would mean the merge field should appear:
{MERGEFIELD "Date2" \@ yyyy-MM-dd}

What are you trying to accomplish with the \b "-" ?


I solved the first issue and created a second problem. I need to
seperate the dates with a " - ". I have a list of events that are
generally speaking one day events. In my document I want to write "The
event takes place 2006-02-04 and is a bla bla bla"

On the odd occasion it is an event spread over several days it should
read...

"The event takes place 2006-02-04 - 2006-02-05 and is a bla bla bla. "

So I need to add a " - " if the second field exists. I can leave the
date in the standard American date format. (In that case the \b switch
works). I can turn the date into the Swedish format but then the code
ignores the b switch.)

What am I missing, how do I combine \@ and \b switches?

Thanks for your answer,,, and time.

Garry Jones
Sweden


  #7   Report Post  
Posted to microsoft.public.word.newusers
Garry Jones
 
Posts: n/a
Default Linking error

"Suzanne S. Barnhill" wrote:
And you haven't answered her question about what the \b switch is supposed to do.


The \b switch should place a string of text before the date2 field if
the date2 field exists.

I am not explaining this very well. I want it to look at the field Date1
and write in the date from that field. I then want it to look at the
field Date2 and write in the date from that field as well (if that field
exists)

In Word if I write

{MERGEFIELD "Date1" \@ yyyy/MM/dd}{MERGEFIELD "Date2" \@ yyyy/MM/dd}

It does exactly what I want with one error. ie - If date1 is "29 May
2006" and date2 is "31 May 2006" it writes

2006052920060531

So I want to seperate these dates so the output in this case should be

20060529 - 20060531

If I was doing this in America I could use

{MERGEFIELD "Date1"}{MERGEFIELD "Date2" \b " - "}

And this would work perfectly and give me the space-hyphen-space
seperator required. However in my case at the same time as using the \b
switch I need to add the date format switch. The use of this seems to
cancel out all attempts of using the \b switch.

So my question is how I can use the \b switch together with the \@
switch.

The little I know of "IF" in word means I find the syntax difficult to
use, so as you suggested I realise I probably need an "IF" and I would
like some guidance in this matter.

Thanks for any help you can give me.

Garry Jones
Sweden
  #8   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill
 
Posts: n/a
Default Linking error

See my reply to your more or less duplicate thread in word.pagelayout.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Garry Jones" wrote in message
...
"Suzanne S. Barnhill" wrote:
And you haven't answered her question about what the \b switch is

supposed to do.

The \b switch should place a string of text before the date2 field if
the date2 field exists.

I am not explaining this very well. I want it to look at the field Date1
and write in the date from that field. I then want it to look at the
field Date2 and write in the date from that field as well (if that field
exists)

In Word if I write

{MERGEFIELD "Date1" \@ yyyy/MM/dd}{MERGEFIELD "Date2" \@ yyyy/MM/dd}

It does exactly what I want with one error. ie - If date1 is "29 May
2006" and date2 is "31 May 2006" it writes

2006052920060531

So I want to seperate these dates so the output in this case should be

20060529 - 20060531

If I was doing this in America I could use

{MERGEFIELD "Date1"}{MERGEFIELD "Date2" \b " - "}

And this would work perfectly and give me the space-hyphen-space
seperator required. However in my case at the same time as using the \b
switch I need to add the date format switch. The use of this seems to
cancel out all attempts of using the \b switch.

So my question is how I can use the \b switch together with the \@
switch.

The little I know of "IF" in word means I find the syntax difficult to
use, so as you suggested I realise I probably need an "IF" and I would
like some guidance in this matter.

Thanks for any help you can give me.

Garry Jones
Sweden


  #9   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor
 
Posts: n/a
Default Linking error


I would give up the struggle and use a conditional field thus

{MERGEFIELD "Date1" \@ yyyy/MM/dd}{IF{MERGEFIELD "Date2"} "" " -
{MERGEFIELD "Date2" \@ yyyy/MM/dd}"}

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Garry Jones wrote:
"Suzanne S. Barnhill" wrote:
And you haven't answered her question about what the \b switch is
supposed to do.


The \b switch should place a string of text before the date2 field if
the date2 field exists.

I am not explaining this very well. I want it to look at the field
Date1 and write in the date from that field. I then want it to look
at the field Date2 and write in the date from that field as well (if
that field exists)

In Word if I write

{MERGEFIELD "Date1" \@ yyyy/MM/dd}{MERGEFIELD "Date2" \@ yyyy/MM/dd}

It does exactly what I want with one error. ie - If date1 is "29 May
2006" and date2 is "31 May 2006" it writes

2006052920060531

So I want to seperate these dates so the output in this case should be

20060529 - 20060531

If I was doing this in America I could use

{MERGEFIELD "Date1"}{MERGEFIELD "Date2" \b " - "}

And this would work perfectly and give me the space-hyphen-space
seperator required. However in my case at the same time as using the
\b switch I need to add the date format switch. The use of this seems
to cancel out all attempts of using the \b switch.

So my question is how I can use the \b switch together with the \@
switch.

The little I know of "IF" in word means I find the syntax difficult to
use, so as you suggested I realise I probably need an "IF" and I would
like some guidance in this matter.

Thanks for any help you can give me.

Garry Jones
Sweden



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
MS VB error Runtime error 160 for Word 2003? Dhana Mailmerge 1 January 5th 06 10:54 AM
error message - ntvdm.exe pattiann Microsoft Word Help 2 November 21st 05 12:10 AM
Help! I'm getting error messages too much-can't open Resume Wizard LizLB Microsoft Word Help 0 May 3rd 05 01:46 AM
Data Execution Prevention Error Frank Microsoft Word Help 0 March 16th 05 12:49 PM
Error Message on Opening Word Suzi Microsoft Word Help 2 February 21st 05 09:53 PM


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