xCav8r
08-02-2005, 02:03 PM
With a few users, the code below doesn't work like I want it to. It's grabbing a textbox from one of two files. The textboxes in the originating templates are aligned absolutely to the page .25" to the right and 10.25" from the top. For all but a few users, the textbox gets inserted onto the desired page as positioned in the template, but sometimes the values here change.
Public Sub InsertFooter(Optional strParams As String)
On Error GoTo InsertFooter_Error:
Dim strUserOptionsPath As String
Dim strFooterFileName As String
strPathToWorkgroupTemplatesFolder = MyAdjustedFilePath _
(strcPathToWorkgroupTemplatesFolder)
strUserOptionsPath = Application.Options.DefaultFilePath(wdUserOptionsPath) & "\"
strFooterFileName = CommandBars.ActionControl.Parameter
If strFooterFileName <> "footer.dot" Or strFooterFileName <> "footerwithpath.dot" Then
strFooterFileName = strParams
End If
ChangeFileOpenDirectory strPathToWorkgroupTemplatesFolder
Selection.EndKey unit:=wdStory
Documents.Open FileName:=strFooterFileName, ConfirmConversions:=False, ReadOnly _
:=True, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _
:="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _
, Format:=wdOpenFormatAuto, XMLTransform:="", Visible:=True
Documents(strFooterFileName).Shapes("PED Footer").Select
Selection.Copy
Documents(strFooterFileName).Close False
Selection.PasteSpecial Link:=False, DataType:=wdPasteShape, Placement:= _
wdFloatOverText, DisplayAsIcon:=False
ChangeMyDirectory (strUserOptionsPath)
InsertFooter_Exit:
Exit Sub
InsertFooter_Error:
strMessage = Err.Source & " generated error#" _
& Err.Number & ": " & Err.Description
MsgBox strMessage
Resume InsertFooter_Exit
End Sub
How do I change this to stick this textbox where I want?
Public Sub InsertFooter(Optional strParams As String)
On Error GoTo InsertFooter_Error:
Dim strUserOptionsPath As String
Dim strFooterFileName As String
strPathToWorkgroupTemplatesFolder = MyAdjustedFilePath _
(strcPathToWorkgroupTemplatesFolder)
strUserOptionsPath = Application.Options.DefaultFilePath(wdUserOptionsPath) & "\"
strFooterFileName = CommandBars.ActionControl.Parameter
If strFooterFileName <> "footer.dot" Or strFooterFileName <> "footerwithpath.dot" Then
strFooterFileName = strParams
End If
ChangeFileOpenDirectory strPathToWorkgroupTemplatesFolder
Selection.EndKey unit:=wdStory
Documents.Open FileName:=strFooterFileName, ConfirmConversions:=False, ReadOnly _
:=True, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _
:="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _
, Format:=wdOpenFormatAuto, XMLTransform:="", Visible:=True
Documents(strFooterFileName).Shapes("PED Footer").Select
Selection.Copy
Documents(strFooterFileName).Close False
Selection.PasteSpecial Link:=False, DataType:=wdPasteShape, Placement:= _
wdFloatOverText, DisplayAsIcon:=False
ChangeMyDirectory (strUserOptionsPath)
InsertFooter_Exit:
Exit Sub
InsertFooter_Error:
strMessage = Err.Source & " generated error#" _
& Err.Number & ": " & Err.Description
MsgBox strMessage
Resume InsertFooter_Exit
End Sub
How do I change this to stick this textbox where I want?