Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2006

Tip: Looking for answers? Try searching our database.

unwanted sql and conversion popups in mergefile

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jiranz - 06 Mar 2006 19:17 GMT
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..
Peter Jamieson - 07 Mar 2006 07:51 GMT
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
>I work with same files on a daily basis for many years. Nothing has changed
>except they updated to Office 11 from previous version..
[quoted text clipped - 23 lines]
> in multiple actions across many files so I believe the problem needs to be
> fixed in Word itself..
Jiranz - 07 Mar 2006 19:18 GMT
#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?

> For the SQL message, follow the instructions in this Knowledgebase
> article:
[quoted text clipped - 46 lines]
>> in multiple actions across many files so I believe the problem needs to
>> be fixed in Word itself..
Peter Jamieson - 07 Mar 2006 19:51 GMT
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

> #1. Solution removed the SQL warning thanks.
>
[quoted text clipped - 56 lines]
>>> hangs in multiple actions across many files so I believe the problem
>>> needs to be fixed in Word itself..
Jiranz - 08 Mar 2006 00:20 GMT
Registry edit solution as found at bottom of page under "More Information"
worked.

Many Thanks.

> 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
[quoted text clipped - 157 lines]
>>>> hangs in multiple actions across many files so I believe the problem
>>>> needs to be fixed in Word itself..
Peter Jamieson - 08 Mar 2006 10:47 GMT
Great - thanks for the useful feedback.

Peter Jamieson
> Registry edit solution as found at bottom of page under "More Information"
> worked.
[quoted text clipped - 163 lines]
>>>>> hangs in multiple actions across many files so I believe the problem
>>>>> needs to be fixed in Word itself..
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.