Hi Jag,
I can't reproduce your issue. I can unlink all fields (including Link
fields) using Unlink. I can also unlink the fields using the Unlink and
BreakLink routine that you have.
Error 4198 is a basic Command Failed error message. Can you click a debug
button on this message? If so, what line in the compiler is highlighted?
Dave
>I have a word template which has a number of graphs (wdfieldlinks created
>by
[quoted text clipped - 33 lines]
>
> jag777
JAG777 - 31 May 2006 16:35 GMT
Hi Dave,
Thanks for your input.
The line of code that fails is 'fldElement.LinkFormat.BreakLink' in the
select case statement.
I can get the links to unlink or break (depending on type) using template
code to manipulate the active document, but the graphs (link fields) don't
show the new figures. If I don't unlink - they do - probably best if I
explain this a little more...
I have an XL wkb and the word .dot template, which has a user form that
starts with the new document event.
The form takes a series of figures, which are used to do two things:
1 - Update a group of docvariable fields through the new word document
2 - Used to update the dataset of the graph in the XL wbk.
The above works fine - i.e. the XL wkb's state is changed as expected after
running the macro and the docvariable fields are all updated accordingly.
What I am trying to achieve (in code within the template) is the equivelent
of right-clicking on each graph (within the newly created doc ), updating the
link (to reflect the changes made via the word to Excel automation) and break
the links.
If I don't use the unlink method, then I get updated graphs and docvariables
- but still have live links (which although is fit for purpose, is not ideal
and looks messy f the user types on a link). If I do use the unlink method, I
get updated docvariables, but graphs as per the template (i.e. they don't
update to the new dataset which is working in the XL wkb?) - hence, my poor
attempt to either break link or unlink based upon the field type.
Hopefully this makes some sense!
Just to add - if you try to emulate the same issue without the use of a
template (i.e. code it within ThisDocument) it seems to work fine. It's
something to do with the template - I think anyway...?
Regards,
jag777
> Hi Jag,
>
[quoted text clipped - 44 lines]
> >
> > jag777