Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Chris K Chris K is offline
external usenet poster
 
Posts: 9
Default Supress "Opening this document with run the following SQL command"

I know this must be asked 1000 times per day - so hopefully there is a
solution

Can I stop word telling me what it's told me a million times before? namely
"Opening this document with run the following SQL command"

It's causing havoc - I am trying to open a document from an Access Form

I can not answer the prompt because it is popping up underneath the modal
form - the form will not budge because it's waiting for the prompt to be
answered

Only solution is CTRL+ALT+DEL

  #2   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Supress "Opening this document with run the following SQL command"

See the following Knowledge Base article:

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

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

Note these newsgroups are no longer hosted by Microsoft and are now orphans
in the wilderness.

As a replacement for the newsgroups, Microsoft has created forums that can
be accessed at:

http://social.answers.microsoft.com/...ory/officeword


--
Hope this helps,

Doug Robbins - Word MVP
dkr[atsymbol]mvps[dot]org

"Chris K" wrote in message
news:QwGbo.110286$Tj3.16275@hurricane...
I know this must be asked 1000 times per day - so hopefully there is a
solution

Can I stop word telling me what it's told me a million times before?
namely "Opening this document with run the following SQL command"

It's causing havoc - I am trying to open a document from an Access Form

I can not answer the prompt because it is popping up underneath the modal
form - the form will not budge because it's waiting for the prompt to be
answered

Only solution is CTRL+ALT+DEL


  #3   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Chris K Chris K is offline
external usenet poster
 
Posts: 9
Default Supress "Opening this document with run the following SQL command"

I'm not in a position to modify registry on company computers but thanks

So the short answer is that Access cannot be used to open an MS Word Mail
merge

P.S. Social Answers forums can not replace the current newsgroups
currently - just took a peek and the existing forums barely scratch the
surface of office apps (Access is hardly mentioned)

Maybe in next 5 years



"Doug Robbins - Word MVP" wrote in message
...
See the following Knowledge Base article:

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

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

Note these newsgroups are no longer hosted by Microsoft and are now
orphans
in the wilderness.

As a replacement for the newsgroups, Microsoft has created forums that can
be accessed at:

http://social.answers.microsoft.com/...ory/officeword


--
Hope this helps,

Doug Robbins - Word MVP
dkr[atsymbol]mvps[dot]org

"Chris K" wrote in message
news:QwGbo.110286$Tj3.16275@hurricane...
I know this must be asked 1000 times per day - so hopefully there is a
solution

Can I stop word telling me what it's told me a million times before?
namely "Opening this document with run the following SQL command"

It's causing havoc - I am trying to open a document from an Access Form

I can not answer the prompt because it is popping up underneath the modal
form - the form will not budge because it's waiting for the prompt to be
answered

Only solution is CTRL+ALT+DEL


  #4   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Supress "Opening this document with run the following SQL command"

If you don't make the registry change, you merely have to acknowledge the
prompt.

There's a macro at http://www.gmayor.com/word_vba_examples.htm which will
toggle the prompt on/off, but as it writes to the registry, I don't suppose
your company IT Nazis will approve of that either? Software does however
write to the registry all the time.

Agreed, the forums are poor, but they are the future ... unless everyone
come back here

--

Graham Mayor - Word MVP

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




"Chris K" wrote in message
news:BrPbo.104930$Nn4.62966@hurricane...
I'm not in a position to modify registry on company computers but thanks

So the short answer is that Access cannot be used to open an MS Word Mail
merge

P.S. Social Answers forums can not replace the current newsgroups
currently - just took a peek and the existing forums barely scratch the
surface of office apps (Access is hardly mentioned)

Maybe in next 5 years



"Doug Robbins - Word MVP" wrote in message
...
See the following Knowledge Base article:

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

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

Note these newsgroups are no longer hosted by Microsoft and are now
orphans
in the wilderness.

As a replacement for the newsgroups, Microsoft has created forums that
can
be accessed at:

http://social.answers.microsoft.com/...ory/officeword


--
Hope this helps,

Doug Robbins - Word MVP
dkr[atsymbol]mvps[dot]org

"Chris K" wrote in message
news:QwGbo.110286$Tj3.16275@hurricane...
I know this must be asked 1000 times per day - so hopefully there is a
solution

Can I stop word telling me what it's told me a million times before?
namely "Opening this document with run the following SQL command"

It's causing havoc - I am trying to open a document from an Access Form

I can not answer the prompt because it is popping up underneath the
modal form - the form will not budge because it's waiting for the prompt
to be answered

Only solution is CTRL+ALT+DEL




  #5   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 42
Default Supress "Opening this document with run the following SQL command"

In message of Sat, 21 Aug 2010
16:10:40 in microsoft.public.word.mailmerge.fields, Graham Mayor
writes
If you don't make the registry change, you merely have to acknowledge the
prompt.

There's a macro at http://www.gmayor.com/word_vba_examples.htm which will
toggle the prompt on/off, but as it writes to the registry, I don't suppose
your company IT Nazis will approve of that either? Software does however
write to the registry all the time.

Agreed, the forums are poor, but they are the future ... unless everyone
come back here


I hope the forums are not the future, but fear I will be wrong.
On reading Doug Robbins recommendation, I followed the link.
I don't think he model does not give me what I have traditionally had
with newsgroups and I don't like what I do get. e.g.
1) one line per thread subject.
2) threading so I can tell the relationship between posts.
This thread is not a good example, as it consists of 4 messages:
a) Chris K posted the first message;
b) Doub Robbins replied to message a)
c) Chris K replied to message b)
d) Graham replied to message c).
3) I normally open a window in which threads containing new messages
appear first and others in which I retain an interest are then shown.
I can mark all messages as read, mark messages as interesting, and/or to
be retained. I can zap old messages when I choose.
4) I can batch download messages for future attention. I don't need an
Internet connection except when sending messages or grabbing them.
5) Cross-posting is supported. Used well, it can be helpful.
5) I can use Google groups to search a vast history of messages.
6) Group, and message creation is largely anarchic.

There are probably virtues in the forums. All I can see to date is
1) They are promoted by Microsoft.
2) Their Traffic is likely to be heavier than in traditional newsgroups
now that they exist.
3) Less spam - I assume this is true.
--
Walter Briscoe


  #6   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Chris K Chris K is offline
external usenet poster
 
Posts: 9
Default Supress "Opening this document with run the following SQL command"



"Graham Mayor" wrote in message
...
If you don't make the registry change, you merely have to acknowledge the
prompt.


as mentioned, the prompt appears underneath the calling form, the form wont
budge (and Word wont open) until the prompt is answered - chicken + egg =
CTRL ALT Del



There's a macro at http://www.gmayor.com/word_vba_examples.htm which will
toggle the prompt on/off, but as it writes to the registry, I don't
suppose your company IT Nazis will approve of that either? Software does
however write to the registry all the time.

Agreed, the forums are poor, but they are the future ... unless everyone
come back here

--

Graham Mayor - Word MVP

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




"Chris K" wrote in message
news:BrPbo.104930$Nn4.62966@hurricane...
I'm not in a position to modify registry on company computers but thanks

So the short answer is that Access cannot be used to open an MS Word Mail
merge

P.S. Social Answers forums can not replace the current newsgroups
currently - just took a peek and the existing forums barely scratch the
surface of office apps (Access is hardly mentioned)

Maybe in next 5 years



"Doug Robbins - Word MVP" wrote in message
...
See the following Knowledge Base article:

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

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

Note these newsgroups are no longer hosted by Microsoft and are now
orphans
in the wilderness.

As a replacement for the newsgroups, Microsoft has created forums that
can
be accessed at:

http://social.answers.microsoft.com/...ory/officeword


--
Hope this helps,

Doug Robbins - Word MVP
dkr[atsymbol]mvps[dot]org

"Chris K" wrote in message
news:QwGbo.110286$Tj3.16275@hurricane...
I know this must be asked 1000 times per day - so hopefully there is a
solution

Can I stop word telling me what it's told me a million times before?
namely "Opening this document with run the following SQL command"

It's causing havoc - I am trying to open a document from an Access Form

I can not answer the prompt because it is popping up underneath the
modal form - the form will not budge because it's waiting for the
prompt to be answered

Only solution is CTRL+ALT+DEL



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Ian[_2_] Ian[_2_] is offline
external usenet poster
 
Posts: 18
Default Supress "Opening this document with run the following SQL command"

In article ,
says...
Agreed, the forums are poor, but they are the future ... unless everyone
come back here


There will always be those of us who prefer to use a newsreader and
access info via Usenet.

Hope all are well.
Ian
--
http://denofslack.wordpress.com/
  #8   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default Supress "Opening this document with run the following SQL command"

On Aug 21, 9:10*am, "Graham Mayor" wrote:

Agreed, the forums are poor, but they are the future ... unless everyone
come back here


Glad to see you back here -- do you have any idea why the macro you
(I'm pretty sure) provided for transposing two letters works _nearly_
immediately on Word2007 on Vista, but very very slowly on Word2007 on
Windows 7, on the laptop whose CPU is otherwise rather faster than the
CPU in the old IBM ThinkCentre desktop?

[followup set]
  #9   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Supress "Opening this document with run the following SQL command"

If you use the Community Bridge to access the newsgroups via an NNTP
newsreader, the experience is much the same as that to which you are
accustomed.

--
Hope this helps,

Doug Robbins - Word MVP
dkr[atsymbol]mvps[dot]org

"Walter Briscoe" wrote in message
...
In message of Sat, 21 Aug 2010
16:10:40 in microsoft.public.word.mailmerge.fields, Graham Mayor
writes
If you don't make the registry change, you merely have to acknowledge the
prompt.

There's a macro at http://www.gmayor.com/word_vba_examples.htm which will
toggle the prompt on/off, but as it writes to the registry, I don't
suppose
your company IT Nazis will approve of that either? Software does however
write to the registry all the time.

Agreed, the forums are poor, but they are the future ... unless everyone
come back here


I hope the forums are not the future, but fear I will be wrong.
On reading Doug Robbins recommendation, I followed the link.
I don't think he model does not give me what I have traditionally had
with newsgroups and I don't like what I do get. e.g.
1) one line per thread subject.
2) threading so I can tell the relationship between posts.
This thread is not a good example, as it consists of 4 messages:
a) Chris K posted the first message;
b) Doub Robbins replied to message a)
c) Chris K replied to message b)
d) Graham replied to message c).
3) I normally open a window in which threads containing new messages
appear first and others in which I retain an interest are then shown.
I can mark all messages as read, mark messages as interesting, and/or to
be retained. I can zap old messages when I choose.
4) I can batch download messages for future attention. I don't need an
Internet connection except when sending messages or grabbing them.
5) Cross-posting is supported. Used well, it can be helpful.
5) I can use Google groups to search a vast history of messages.
6) Group, and message creation is largely anarchic.

There are probably virtues in the forums. All I can see to date is
1) They are promoted by Microsoft.
2) Their Traffic is likely to be heavier than in traditional newsgroups
now that they exist.
3) Less spam - I assume this is true.
--
Walter Briscoe


  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Supress "Opening this document with run the following SQL command"

I have not been away With such low traffic, there have been few
opportunities to comment.
I don't remember the particular macro, but I don't use Windows 7 so cannot
check it out. If you post the code, someone else may be able to check it.

--

Graham Mayor - Word MVP

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



"Peter T. Daniels" wrote in message
...
On Aug 21, 9:10 am, "Graham Mayor" wrote:

Agreed, the forums are poor, but they are the future ... unless everyone
come back here


Glad to see you back here -- do you have any idea why the macro you
(I'm pretty sure) provided for transposing two letters works _nearly_
immediately on Word2007 on Vista, but very very slowly on Word2007 on
Windows 7, on the laptop whose CPU is otherwise rather faster than the
CPU in the old IBM ThinkCentre desktop?

[followup set]




  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default macro for transposing letters Supress "Opening this document withrun the following SQL command"

Here's the code:

Sub Transpose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters to transpose?"
Msg3 = "There is no document open!"
MsgTitle = "Transpose Characters"
On Error GoTo ErrorHandler
If ActiveDocument.Characters.Count 2 Then
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
Else
MsgBox Msg2, vbCritical, MsgTitle
End If
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub

On Aug 22, 1:57*am, "Graham Mayor" wrote:
I have not been away With such low traffic, there have been few
opportunities to comment.
I don't remember the particular macro, but I don't use Windows 7 so cannot
check it out. If you post the code, someone else may be able to check it.

--

Graham Mayor - *Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Peter T. Daniels" wrote in ...
On Aug 21, 9:10 am, "Graham Mayor" wrote:

Agreed, the forums are poor, but they are the future ... unless everyone
come back here


Glad to see you back here -- do you have any idea why the macro you
(I'm pretty sure) provided for transposing two letters works _nearly_
immediately on Word2007 *on Vista, but very very slowly on Word2007 on
Windows 7, on the laptop whose CPU is otherwise rather faster than the
CPU in the old IBM ThinkCentre desktop?

[followup set]


  #12   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement
John W. Vinson John W. Vinson is offline
external usenet poster
 
Posts: 1
Default Supress "Opening this document with run the following SQL command"

On Sat, 21 Aug 2010 14:51:59 +0100, Walter Briscoe
wrote:

There are probably virtues in the forums. All I can see to date is
1) They are promoted by Microsoft.
2) Their Traffic is likely to be heavier than in traditional newsgroups
now that they exist.


Much lighter, at least so far. MS is not prominently publicizing these groups,
and they seem to be harder to find than the newsgroups.

3) Less spam - I assume this is true.


That at least appears to be the case - there are moderators who do remove
blatant spam promptly. The registration requirement (even if it's just the
need to use a msn email account) probably does the most to keep spam down.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
  #13   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields,microsoft.public.word.mailmergefields
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Supress "Opening this document with run the following SQL command"

You can download the Answers Bridge (provided by MS even though it does
claim to be "not a Microsoft developed application") from
https://connect.microsoft.com/Micros...?wa=wsignin1.0 and the
Community Bridge (written by an MVP) from
http://communitybridge.codeplex.com/.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Doug Robbins - Word MVP" wrote in message
...
If you use the Community Bridge to access the newsgroups via an NNTP
newsreader, the experience is much the same as that to which you are
accustomed.

--
Hope this helps,

Doug Robbins - Word MVP
dkr[atsymbol]mvps[dot]org

"Walter Briscoe" wrote in message
...
In message of Sat, 21 Aug 2010
16:10:40 in microsoft.public.word.mailmerge.fields, Graham Mayor
writes
If you don't make the registry change, you merely have to acknowledge the
prompt.

There's a macro at http://www.gmayor.com/word_vba_examples.htm which will
toggle the prompt on/off, but as it writes to the registry, I don't
suppose
your company IT Nazis will approve of that either? Software does however
write to the registry all the time.

Agreed, the forums are poor, but they are the future ... unless everyone
come back here


I hope the forums are not the future, but fear I will be wrong.
On reading Doug Robbins recommendation, I followed the link.
I don't think he model does not give me what I have traditionally had
with newsgroups and I don't like what I do get. e.g.
1) one line per thread subject.
2) threading so I can tell the relationship between posts.
This thread is not a good example, as it consists of 4 messages:
a) Chris K posted the first message;
b) Doub Robbins replied to message a)
c) Chris K replied to message b)
d) Graham replied to message c).
3) I normally open a window in which threads containing new messages
appear first and others in which I retain an interest are then shown.
I can mark all messages as read, mark messages as interesting, and/or to
be retained. I can zap old messages when I choose.
4) I can batch download messages for future attention. I don't need an
Internet connection except when sending messages or grabbing them.
5) Cross-posting is supported. Used well, it can be helpful.
5) I can use Google groups to search a vast history of messages.
6) Group, and message creation is largely anarchic.

There are probably virtues in the forums. All I can see to date is
1) They are promoted by Microsoft.
2) Their Traffic is likely to be heavier than in traditional newsgroups
now that they exist.
3) Less spam - I assume this is true.
--
Walter Briscoe




  #14   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default macro for transposing letters Supress "Opening this documentwith run the following SQL command"

Turns out it works at normal speed in a small (10-p.) document; the
one it's slow in is 180 pp. But since the pair of characters it works
on is the two characters on either side of the cursor (or two selected
characters), why would it need to search the entire file?

On Aug 22, 8:45*am, "Peter T. Daniels" wrote:
Here's the code:

SubTranspose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
* * * *"the 2 characters to be transposed!"
Msg2 = "There are no characters totranspose?"
Msg3 = "There is no document open!"
MsgTitle = "TransposeCharacters"
On Error GoTo ErrorHandler
If ActiveDocument.Characters.Count 2 Then
* * Set oRng = Selection.Range
* * Select Case Len(oRng)
* * Case Is = 0
* * * * If oRng.Start = oRng.Paragraphs(1).Range.Start Then
* * * * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * * * Exit Sub
* * * * End If
* * * * If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
* * * * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * * * Exit Sub
* * * * End If
* * * * With oRng
* * * * * * .Start = .Start - 1
* * * * * * .End = .End + 1
* * * * * * .Select
* * * * * * sText = .Text
* * * * End With
* * Case Is = 1
* * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * Exit Sub
* * Case Is = 2
* * * * sText = Selection.Range.Text
* * Case Else
* * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * Exit Sub
* * End Select
* * With Selection
* * * * If .Range.Characters(1).Case = 1 _
* * * * * * And .Range.Characters(2).Case = 0 Then
* * * * * * .TypeText UCase(Mid(sText, 2, 1)) & _
* * * * * * LCase(Mid(sText, 1, 1))
* * * * Else
* * * * * * .TypeText Mid(sText, 2, 1) & _
* * * * * * Mid(sText, 1, 1)
* * * * End If
* * * * .MoveLeft wdCharacter
* * End With
Else
* * MsgBox Msg2, vbCritical, MsgTitle
End If
End
ErrorHandler:
If Err.Number = 4248 Then
* * MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub

On Aug 22, 1:57*am, "Graham Mayor" wrote:



I have not been away With such low traffic, there have been few
opportunities to comment.
I don't remember the particular macro, but I don't use Windows 7 so cannot
check it out. If you post the code, someone else may be able to check it.

  #15   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default macro for transposing letters Supress "Opening this document with run the following SQL command"

The delay is attributable to the character count used as part of the error
checking. You can remove that part of the error checking and it will respond
instantly - provided there are characters to transpose when you run it.


Sub Transpose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters to transpose?"
Msg3 = "There is no document open!"
MsgTitle = "Transpose Characters"
On Error GoTo ErrorHandler
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub

"Peter T. Daniels" wrote in message
...
Turns out it works at normal speed in a small (10-p.) document; the
one it's slow in is 180 pp. But since the pair of characters it works
on is the two characters on either side of the cursor (or two selected
characters), why would it need to search the entire file?

On Aug 22, 8:45 am, "Peter T. Daniels" wrote:
Here's the code:

SubTranspose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters totranspose?"
Msg3 = "There is no document open!"
MsgTitle = "TransposeCharacters"
On Error GoTo ErrorHandler
If ActiveDocument.Characters.Count 2 Then
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
Else
MsgBox Msg2, vbCritical, MsgTitle
End If
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub

On Aug 22, 1:57 am, "Graham Mayor" wrote:



I have not been away With such low traffic, there have been few
opportunities to comment.
I don't remember the particular macro, but I don't use Windows 7 so
cannot
check it out. If you post the code, someone else may be able to check
it.


--

Graham Mayor - Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Peter T. Daniels" wrote in
...
On Aug 21, 9:10 am, "Graham Mayor" wrote:


Agreed, the forums are poor, but they are the future ... unless
everyone
come back here


Glad to see you back here -- do you have any idea why the macro you
(I'm pretty sure) provided for transposing two letters works _nearly_
immediately on Word2007 on Vista, but very very slowly on Word2007 on
Windows 7, on the laptop whose CPU is otherwise rather faster than the
CPU in the old IBM ThinkCentre desktop?


[followup set]-





  #16   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default macro for transposing letters Supress "Opening this documentwith run the following SQL command"

It seems you deleted one line near the beginning and three lines near
the end. Can I also remove the lines containing or mentioning "Msg2"
at the top? Or would all the "Msg3" mentions have to be changed to
"Msg2"?

On Aug 29, 3:29*am, "Graham Mayor" wrote:
The delay is attributable to the character count used as part of the error
checking. You can remove that part of the error checking and it will respond
instantly - provided there are characters to transpose when you run it.

Sub Transpose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
* * * *"the 2 characters to be transposed!"
Msg2 = "There are no characters to transpose?"
Msg3 = "There is no document open!"
MsgTitle = "Transpose Characters"
On Error GoTo ErrorHandler
* * Set oRng = Selection.Range
* * Select Case Len(oRng)
* * Case Is = 0
* * * * If oRng.Start = oRng.Paragraphs(1).Range.Start Then
* * * * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * * * Exit Sub
* * * * End If
* * * * If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
* * * * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * * * Exit Sub
* * * * End If
* * * * With oRng
* * * * * * .Start = .Start - 1
* * * * * * .End = .End + 1
* * * * * * .Select
* * * * * * sText = .Text
* * * * End With
* * Case Is = 1
* * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * Exit Sub
* * Case Is = 2
* * * * sText = Selection.Range.Text
* * Case Else
* * * * MsgBox Msg1, vbCritical, MsgTitle
* * * * Exit Sub
* * End Select
* * With Selection
* * * * If .Range.Characters(1).Case = 1 _
* * * * * * And .Range.Characters(2).Case = 0 Then
* * * * * * .TypeText UCase(Mid(sText, 2, 1)) & _
* * * * * * LCase(Mid(sText, 1, 1))
* * * * Else
* * * * * * .TypeText Mid(sText, 2, 1) & _
* * * * * * Mid(sText, 1, 1)
* * * * End If
* * * * .MoveLeft wdCharacter
* * End With
End
ErrorHandler:
If Err.Number = 4248 Then
* * MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub

"Peter T. Daniels" wrote in ...
Turns out it works at normal speed in a small (10-p.) document; the
one it's slow in is 180 pp. But since the pair of characters it works
on is the two characters on either side of the cursor (or two selected
characters), why would it need to search the entire file?

On Aug 22, 8:45 am, "Peter T. Daniels" wrote:



Here's the code:


SubTranspose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters totranspose?"
Msg3 = "There is no document open!"
MsgTitle = "TransposeCharacters"
On Error GoTo ErrorHandler
If ActiveDocument.Characters.Count 2 Then
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
Else
MsgBox Msg2, vbCritical, MsgTitle
End If
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub


On Aug 22, 1:57 am, "Graham Mayor" wrote:


I have not been away With such low traffic, there have been few
opportunities to comment.
I don't remember the particular macro, but I don't use Windows 7 so
cannot
check it out. If you post the code, someone else may be able to check
it.


--

Graham Mayor - Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Peter T. Daniels" wrote in
...
On Aug 21, 9:10 am, "Graham Mayor" wrote:


Agreed, the forums are poor, but they are the future ... unless
everyone
come back here


Glad to see you back here -- do you have any idea why the macro you
(I'm pretty sure) provided for transposing two letters works _nearly_
immediately on Word2007 on Vista, but very very slowly on Word2007 on
Windows 7, on the laptop whose CPU is otherwise rather faster than the
CPU in the old IBM ThinkCentre desktop?


[followup set]--

  #17   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default macro for transposing letters Supress "Opening this document with run the following SQL command"

Yes you can remove the references to Msg2 as they are now redundant. You can
change the references to Msg3 to Msg2 if you wish, but it will work just the
same without.

--

Graham Mayor - Word MVP

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



"Peter T. Daniels" wrote in message
...
It seems you deleted one line near the beginning and three lines near
the end. Can I also remove the lines containing or mentioning "Msg2"
at the top? Or would all the "Msg3" mentions have to be changed to
"Msg2"?

On Aug 29, 3:29 am, "Graham Mayor" wrote:
The delay is attributable to the character count used as part of the error
checking. You can remove that part of the error checking and it will
respond
instantly - provided there are characters to transpose when you run it.

Sub Transpose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters to transpose?"
Msg3 = "There is no document open!"
MsgTitle = "Transpose Characters"
On Error GoTo ErrorHandler
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub

"Peter T. Daniels" wrote in
...
Turns out it works at normal speed in a small (10-p.) document; the
one it's slow in is 180 pp. But since the pair of characters it works
on is the two characters on either side of the cursor (or two selected
characters), why would it need to search the entire file?

On Aug 22, 8:45 am, "Peter T. Daniels" wrote:



Here's the code:


SubTranspose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters totranspose?"
Msg3 = "There is no document open!"
MsgTitle = "TransposeCharacters"
On Error GoTo ErrorHandler
If ActiveDocument.Characters.Count 2 Then
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
Else
MsgBox Msg2, vbCritical, MsgTitle
End If
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub


On Aug 22, 1:57 am, "Graham Mayor" wrote:


I have not been away With such low traffic, there have been few
opportunities to comment.
I don't remember the particular macro, but I don't use Windows 7 so
cannot
check it out. If you post the code, someone else may be able to check
it.


--

Graham Mayor - Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Peter T. Daniels" wrote in
...
On Aug 21, 9:10 am, "Graham Mayor" wrote:


Agreed, the forums are poor, but they are the future ... unless
everyone
come back here


Glad to see you back here -- do you have any idea why the macro you
(I'm pretty sure) provided for transposing two letters works _nearly_
immediately on Word2007 on Vista, but very very slowly on Word2007 on
Windows 7, on the laptop whose CPU is otherwise rather faster than the
CPU in the old IBM ThinkCentre desktop?


[followup set]--



  #18   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default macro for transposing letters Supress "Opening this documentwith run the following SQL command"

Ok -- thanks for the fix!

On Aug 29, 10:00*am, "Graham Mayor" wrote:
Yes you can remove the references to Msg2 as they are now redundant. You can
change the references to Msg3 to Msg2 if you wish, but it will work just the
same without.

--

Graham Mayor - *Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Peter T. Daniels" wrote in ...
It seems you deleted one line near the beginning and three lines near
the end. Can I also remove the lines containing or mentioning "Msg2"
at the top? Or would all the "Msg3" mentions have to be changed to
"Msg2"?

On Aug 29, 3:29 am, "Graham Mayor" wrote:



The delay is attributable to the character count used as part of the error
checking. You can remove that part of the error checking and it will
respond
instantly - provided there are characters to transpose when you run it.


Sub Transpose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters to transpose?"
Msg3 = "There is no document open!"
MsgTitle = "Transpose Characters"
On Error GoTo ErrorHandler
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub


"Peter T. Daniels" wrote in
...
Turns out it works at normal speed in a small (10-p.) document; the
one it's slow in is 180 pp. But since the pair of characters it works
on is the two characters on either side of the cursor (or two selected
characters), why would it need to search the entire file?


On Aug 22, 8:45 am, "Peter T. Daniels" wrote:


Here's the code:


SubTranspose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters totranspose?"
Msg3 = "There is no document open!"
MsgTitle = "TransposeCharacters"
On Error GoTo ErrorHandler
If ActiveDocument.Characters.Count 2 Then
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
Else
MsgBox Msg2, vbCritical, MsgTitle
End If
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub


On Aug 22, 1:57 am, "Graham Mayor" wrote:


I have not been away With such low traffic, there have been few
opportunities to comment.
I don't remember the particular macro, but I don't use Windows 7 so
cannot
check it out. If you post the code, someone else may be able to check
it.


--

Graham Mayor - Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


"Peter T. Daniels" wrote in
...
On Aug 21, 9:10 am, "Graham Mayor" wrote:


Agreed, the forums are poor, but they are the future ... unless
everyone
come back here


Glad to see you back here -- do you have any idea why the macro you
(I'm pretty sure) provided for transposing two letters works _nearly_
immediately on Word2007 on Vista, but very very slowly on Word2007 on
Windows 7, on the laptop whose CPU is otherwise rather faster than the
CPU in the old IBM ThinkCentre desktop?


[followup set]--- Hide quoted text -


- Show quoted text -


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
Opening this will run the following SQL command WimDeBoeck Mailmerge 5 July 10th 12 10:26 PM
How to prevent sql command warning when opening merge document Daversey Mailmerge 2 April 22nd 12 04:54 AM
"Opening this document will run the following SQL command" prompt problem BradH Mailmerge 4 April 28th 09 10:35 AM
MS Word Warning on start up run SQL command - How to stop? slucker Microsoft Word Help 1 October 28th 05 05:29 PM
Word Merge "opening this document will run the following SQL comma bet_saliz Mailmerge 1 August 31st 05 04:41 PM


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