|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by kdjch in Microsoft Word, VB Script
Hello
I wrote the following macro shown below 18 months ago and it has been used by at least 40 users several times daily ever since. It is saved in one shared template. About one week ago, one user noted that the macro stopped with an error.
Runtime error '-2147467259 (80004005)' on the method "Convert to Shape" for the Object "InlineShape".
The line where it stops is: Set PDF_D = DolderD.ConvertToShape
The code is shown below.
Since then, more and more users are experiencing this error, but not all the time. I cannot figure out where to start looking.
Office 2003
Windows XP
Windows Network
Any tips??
Thank you so much!
KDJ
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
|
Dim DolderD As Word.InlineShape
Dim Address As Word.InlineShape
Dim PDF_D As Word.Shape
Dim PDF_Address As Word.Shape
Dim rng As Word.Range
Dim HD As Word.HeaderFooter
'Cursor at beginning of text
Selection.HomeKey Unit:=wdStory
'Set up Header
With ActiveDocument.Sections(1)
.PageSetup.DifferentFirstPageHeaderFooter = True
.PageSetup.HeaderDistance = CentimetersToPoints(4.8)
End With
Set HD = ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage)
Set rng = HD.Range
'Add DolderD
Set DolderD = rng.InlineShapes.AddPicture(FileName:= _
"H:\Hogaroot\Template\Word\Dolder Big D.jpg", LinkToFile:= _
False, SaveWithDocument:=True)
'Format DolderD
DolderD.Width = CentimetersToPoints(18.62)
DolderD.Height = CentimetersToPoints(18.91)
Set PDF_D = DolderD.ConvertToShape
PDF_D.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionPage
PDF_D.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
PDF_D.Left = CentimetersToPoints(1.58)
PDF_D.Top = CentimetersToPoints(0.61)
'Set up Footer
Set HD = ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage)
Set rng = HD.Range
'Add Address
Set Address = rng.InlineShapes.AddPicture(FileName:= _
"H:\Hogaroot\Template\Word\Dolder Address.jpg", LinkToFile:= _
False, SaveWithDocument:=True)
'Format Address
Address.Width = CentimetersToPoints(3.53)
Address.Height = CentimetersToPoints(7.87)
Set PDF_Address = Address.ConvertToShape
PDF_Address.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionPage
PDF_Address.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
PDF_Address.Left = CentimetersToPoints(16.49)
PDF_Address.Top = CentimetersToPoints(21.2)
End Sub
|
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625