View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jiranz
 
Posts: n/a
Default unwanted sql and conversion popups in mergefile

Registry edit solution as found at bottom of page under "More Information"
worked.

Many Thanks.


"Peter Jamieson" wrote in message
...
OK, I'm not sure about this - there is some discussion in the MS
Knowledgebase of a hotfix and a fix in Word 2003 SP1 which involves a
registry entry called DefaultCPG which lets you specify the "code page"
(i.e. encoding" that you want Windows to assume if you don't specify
anything else). However, I can't work out exactly what has been fixed in
which version or whether it would help you. You can find more info. at

http://support.microsoft.com/kb/834948/en-us

- it may be worth trying to create and set the registry entry to see what
happens.

Otherwise, I think you have to consider opening the file using a Word
macro (say) and saving it using an unambiguous encoding such as UTF-8 or
(safer, usually) saving it as a Word file. SOme code you could use...

Some sample conversion macros...

Sub ConvertToUTF8()
' convert to a UTF8 format text file

' Needs error checking etc.
Dim oDoc as Word.Document

' change msoEncodingWestern to be the encoding you need. I think this
should
work.

Set oDoc = Documents.Open("the path name of the file you need to
convert.txt", _
False, , False, , , , , , _
wdOpenFormatEncodedText, _
msoEncodingWestern, _
False, False, , True)

' Several of the parameters here are optional or
' irrelevant - you can probably remove the lines from
' ReadOnlyRecommended to SaveAsAOCLetter

oDoc.SaveAs _
FileName:="the path name of the file to convert to.txt", _
FileFormat:=wdFormatUnicodeTex*t, _
AddToRecentFiles:=False, _
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False*, _
SaveFormsData:=False, _
SaveAsAOCLetter:=False, _
Encoding:=msoEncodingUTF8, _
InsertLineBreaks:=False, _
AllowSubstitutions:=False, _
LineEnding:=wdCRLF

oDoc.Close Savechanges:=False
Set oDoc = Nothing
End Sub

or

Sub ConvertToWord()
' convert to a Word document file

' Needs error checking etc.
Dim oDoc as Word.Document

' change msoEncodingWestern to be the encoding you need. I think this
should
work.

Set oDoc = Documents.Open("the path name of the file you need to
convert.txt", _
False, , False, , , , , , _
wdOpenFormatEncodedText, _
msoEncodingWestern, _
False, False, , True)

' Several of the parameters here are optional or
' irrelevant - you can probably remove the lines from
' ReadOnlyRecommended to Encoding

oDoc.SaveAs _
FileName:="the path name of the file to convert to.doc", _
FileFormat:=wdFormatDocument, _
AddToRecentFiles:=False, _
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False*, _
SaveFormsData:=False, _
SaveAsAOCLetter:=False, _
Encoding:=msoEncodingUTF8, _
InsertLineBreaks:=False, _
AllowSubstitutions:=False, _
LineEnding:=wdCRLF

oDoc.Close Savechanges:=False
Set oDoc = Nothing
End Sub


Peter Jamieson


"Jiranz" wrote in message
...
#1. Solution removed the SQL warning thanks.

#2. "Confirm coversions at open" is not checked and "File Conversion" box
still opens every time.

The box offers "Windows (default)". This default works OK with my docs. I
am not aware of any scenario where I have needed any of the other two
options. Is there some way to make it accept the "Windows" option as a
global default without user intervention being required?


"Peter Jamieson" wrote in message
...
For the SQL message, follow the instructions in this Knowledgebase
article:

"Opening This Will Run the Following SQL Command" Message When You Open
a
Word Document"

at

http://support.microsoft.com?kbid=825765

For this,...

Next a second box opens...
"File Conversion..." with three options so again I click "OK" and then
the
file opens.

...see if Word Tools|Options|General|"Confirm coversions at open" is
checked. If it is, that is probably the source of your problem - uncheck
it. If not, get back to us.

Peter Jamieson
"Jiranz" wrote in message
...
I work with same files on a daily basis for many years. Nothing has
changed except they updated to Office 11 from previous version..

This particular Word doc extracts data from a delimited file created
by another (DOS) program and puts it into a merge file for printing to
clients.

With previous versions Word doc imports mergedata from external
database and loads up immediately ready for printing. But since upgrade
to 2003 now the process is halted two times for user manual input

Now when trying to open the file first I get...
"Opening this doc will run the following SQL Command:...Do you want to
contimue?". I have to click in order to continue.

Next a second box opens...
"File Conversion..." with three options so again I click "OK" and then
the
file opens.

Why is it doing this? It is adding to the workload as somedays several
files do it 30-40 times.
So how do I bypass these extra two popup windows and make openfile with
mergefields process same as with previous versions of Word?

I made a macro with autohotkey but it suffers occasional failure or
hangs in multiple actions across many files so I believe the problem
needs to be fixed in Word itself..