Hello all,
Sorry to jump in with my very first post being this one, but I'm at a loss as to what's going on so I would appreciate some guidance if anyone is willing...
I have a script that runs perfectly well on everyone's computer in my company except 1 person. For that one person they get the runtime error above (error -2147467259 (80004005)).
Here what the script should do...
It should go to the footer. Look for "XXX" and replace it with a small logo.
Like I said, it works every time on everyone else's computer so I don't think there's anything wrong with the code. I'm wondering if there is something wrong with the user's setup.
What happens with this user is this (when I step into the code)...
The code finds the footer, then it adds the logo to the TOP LEFT of the HEADER. Then the error message appears.
Here's the code...
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
With Selection.Find
.Text = "XXX"
.Forward = True
.Wrap = wdFindContinue
.Format = False
Do While .Execute
Selection.InlineShapes.AddPicture filename:= _
"\\filepath\pictureName.JPG" _
, LinkToFile:=False, SaveWithDocument:=True
Loop
.Execute
End With
However, if I change the inlineshapes line to...
selection.typetext text:= "Hello"
It works fine.
Does anyone have any suggestions on what is going on?
Many thanks in advance.
Andre