Problems with document variables in .docx file shared between Word

D

Dale

Hi there,

In brief, I have Word documents that are created in Word 2007 in a Vista
environment that have document variables in them that later need to be opened
up in both Vista/Word 2007 and XP/Word 2003 environments and encountering
problems with newline/CRLF's when opening up in XP/Word 2003.

So specifically, I have a VB6 application that populates some document
variables and I am encountering problems with how carriage return linefeeds
are interpreted. Word 2007 seems to be the issue in terms of compatibility
with Word 2003.

If the document is created in Word 2007 and saved as a .docx and I dump out
the varible and it's value, it looks like this:

strKids
this child 2009 Jun 01
that child 2009 Jun 05

the last two lines are separated by a new line which is good (and this is
how it always used to work when creating a .doc in Word 2003 and dumping out
the variables in Word 2003) but if I open this file in Word 2003 and dump out
the variables, I get this:

strKids this child 2009 Jun 01_x000d__x000a_that child 2009 Jun 05

Somehow the vbCrLf in a Word 2007 is messed up when it's interpreted by Word
2003. Any suggestions? Thanks.
 
D

Dale

Tony, thanks a lot for the quick response ... I installed the hotfix but it
didn't fix my issue. The issue described in the hotfix seems related but not
what I was experiencing, the carriage return does not appear to be lost in
the save but it appears to be interpreted incorrectly when opening up the
2007 docx in Word 2003. Any ideas? Thanks.
 
T

Tony Jollans

I know nothing of the issue; I know of the hotfix for other reasons and just
noticed that the description seemed to be what you were describing. I'll try
and have a look later but am a bit busy today.
 
D

Dale

Thanks a lot Tony ... man, I been googling all over and checking/posting on
forums but found nothing.
 
D

Doug Robbins - Word MVP

What exactly do you mean by "dump out" and what is the code that is being
used to do it?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
D

Dale

Hi Doug,

I just used this code in the VB window of the Word document:

Sub varia()
Dim ovar As Variable
For Each ovar In ActiveDocument.Variables
Debug.Print ovar.Name
Debug.Print ovar.Value
Next ovar
End Sub

Tony, Doug, thanks a lot for the responses, I think I got a fix by changing
my VB6 app that was re-reading those variables under XP and Word 2003. Still
be interesting to know if this was some incompatibilty between the way Word
does things from 2003 to 2007.
 
D

Doug Robbins - Word MVP

I am not aware of any difference. But of course have no idea what you VB6
app is doing.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top