well, that's the question: how do i programmatically change a given link to
excel from automatic updating to manual updating (the recorder doesn't catch
any of the key strokes)

Re: changing excel links from automatic to manual update by macropod

macropod
Wed Jul 16 14:40:29 PDT 2008

Hi VBAbraham,

You could lock the field. Note though, that if automatic updating is 'on', you'll need to have the field locked before that process
occurs. I'm not sure if that means the field will have to be locked before the document is opened.

--
Cheers
macropod
[MVP - Microsoft Word]


"VBAbraham" <VBAbraham@discussions.microsoft.com> wrote in message news:42AF2450-D248-44E7-9401-CA54F2756B3B@microsoft.com...
> well, that's the question: how do i programmatically change a given link to
> excel from automatic updating to manual updating (the recorder doesn't catch
> any of the key strokes)


Re: changing excel links from automatic to manual update by Greg

Greg
Wed Jul 16 17:47:53 PDT 2008

On Jul 16, 11:36=A0am, VBAbraham <VBAbra...@discussions.microsoft.com>
wrote:
> well, that's the question: how do i programmatically change a given link =
to
> excel from automatic updating to manual updating (the recorder doesn't ca=
tch
> any of the key strokes)

You might try:

Sub ScratchMacro()
Dim oFld As Word.Field
Dim pStr As String
For Each oFld In ActiveDocument.Range.Fields
If oFld.Type =3D wdFieldLink Then
pStr =3D oFld.Code.Text
pStr =3D Replace(pStr, "\a", "")
oFld.Code.Text =3D pStr
pStr =3D ""
End If
Next oFld
End Sub

Re: changing excel links from automatic to manual update by VBAbraham

VBAbraham
Wed Jul 16 19:33:01 PDT 2008

Thanks, Greg

It works perfectly, and so simple

I also fixed the problem by leaving the links in word alone and changing the
links in excel (coming from a DDE) to manual - the cursor in word kept
spinning otherwise

"Greg Maxey" wrote:

> On Jul 16, 11:36 am, VBAbraham <VBAbra...@discussions.microsoft.com>
> wrote:
> > well, that's the question: how do i programmatically change a given link to
> > excel from automatic updating to manual updating (the recorder doesn't catch
> > any of the key strokes)
>
> You might try:
>
> Sub ScratchMacro()
> Dim oFld As Word.Field
> Dim pStr As String
> For Each oFld In ActiveDocument.Range.Fields
> If oFld.Type = wdFieldLink Then
> pStr = oFld.Code.Text
> pStr = Replace(pStr, "\a", "")
> oFld.Code.Text = pStr
> pStr = ""
> End If
> Next oFld
> End Sub
>

Re: changing excel links from automatic to manual update by Gregory

Gregory
Wed Jul 16 19:56:19 PDT 2008

Good. Thanks.

VBAbraham wrote:
> Thanks, Greg
>
> It works perfectly, and so simple
>
> I also fixed the problem by leaving the links in word alone and
> changing the links in excel (coming from a DDE) to manual - the
> cursor in word kept spinning otherwise
>
> "Greg Maxey" wrote:
>
>> On Jul 16, 11:36 am, VBAbraham <VBAbra...@discussions.microsoft.com>
>> wrote:
>>> well, that's the question: how do i programmatically change a given
>>> link to excel from automatic updating to manual updating (the
>>> recorder doesn't catch any of the key strokes)
>>
>> You might try:
>>
>> Sub ScratchMacro()
>> Dim oFld As Word.Field
>> Dim pStr As String
>> For Each oFld In ActiveDocument.Range.Fields
>> If oFld.Type = wdFieldLink Then
>> pStr = oFld.Code.Text
>> pStr = Replace(pStr, "\a", "")
>> oFld.Code.Text = pStr
>> pStr = ""
>> End If
>> Next oFld
>> End Sub