I should have mentioned that I am running the Office 2007 on a Windows 7 machine, but the issue is the same on an XP machine. Also, the Office 2003 runs flawless on either OS (XP or Win7).
This is a very large and complicated application which was developed in the 2003 VB enviroment, so I wouldn't want to refer to it as a macro. I have saved the program in a .bas format, but i see no provision here to append a file. A copy and paste would be impractical due to size and the requirement of many supporting external documents.
In the simplest explanation as to what I am doing, the program scores a test that has been taken online, opens a blank forms document and writes the results into this document.
Following is a short section of the code that seems to be the slowest link. I wish I could include the blank form page which this section is working with. So is there a way to include attachments here?
(I tried pasting a copy of the form that is being filled out by this code but it was useless as it doesn't show the table structure.)
Added note: For the most part, the noscore code never runs so it is not the issue.
For x = 1 To ab
If test_score(x) = 0.5 Then GoTo noscore
Selection.GoTo What:=wdGoToBookmark, Name:="p11score" + LTrim$(Str(x))
ActiveDocument.FormFields("p11score" + LTrim(Str(x))).Result = test_score(x)
numtabs = test_score(x) * 2 + 3
Selection.MoveRight Unit:=wdCell, Count:=numtabs
Selection.Shading.Texture = wdTexture40Percent
Selection.MoveRight Unit:=wdCell
Selection.Shading.Texture = wdTexture40Percent
noscore:
If job_fam$ > "" Then
Selection.GoTo What:=wdGoToBookmark, Name:="p11score" + LTrim$(Str(x))
If hi(x) > 0 Then
numtabs = low(x) * 2 + 3
Selection.MoveRight Unit:=wdCell, Count:=numtabs
If WordBasic.ShadingPattern() = 7 Then
Selection.Shading.Texture = wdTexture50Percent
Else
Selection.Shading.Texture = wdTexture25Percent
End If
For z = 1 To ((hi(x) - low(x)) * 2 + 1)
Selection.MoveRight Unit:=wdCell
If WordBasic.ShadingPattern() = 7 Then
Selection.Shading.Texture = wdTexture50Percent
Else
Selection.Shading.Texture = wdTexture25Percent
End If
Next z
End If
End If
Next x
(this is ugly but gives some vague idea)
Name: David Van Straten
ID: CCode / QNNTG3LF
Position: Attorney
Company: U.S. Venture, Inc.
HP:
VP: 50 / 2
NSight