W
Workgroups
I want to insert the shape on the last page of a document (whatever page #
that may be, it's variable). It's a textbox with some text in it, and it's
background is filled with a bitmap of someone's signature - it goes on the
last page in the bottom-right corner to "sign" a document. Our users "apply
a signature to the document" by clicking a little macro button that does
[essentially] this:
Dim objYouWereHere as Range
Set objYouWereHere = Selection.Range
Application.ScreenUpdating = False
'Physically move to the "last page"
Selection.EndKey Unit:=wdStory
'Position the signature textbox
With ActiveDocument.Shapes("SignatureBox")
.Top = 536
.Left = 231
End With
'Return my user to wherever they were prior to running the macro
objYouWereHere.Select
Application.ScreenUpdating = True
I'm not well versed enough in word/vba to know the answer to this; but is it
possible to programatically define the last page (maybe as a range?) in such
a way that I could insert a shape onto it at an x, y coordinate relative to
that page **without** having to move the selection? With the above
methodology, the user does end up at wherever they were prior to running the
macro, but the objYouWereHere.Select call can sometimes leave them at a new
vertical scroll position and it's a little disorienting for them.
So, before I go hunting down how to store & retreive the vertical scroll
position (similar to how I store and retrieve the selection pre & post
textbox adjustment)... is there a more "elegant" way to do this that doesn't
require I move the selection at all? Insert shape at x, y on page n,
without involving the Selection?
that may be, it's variable). It's a textbox with some text in it, and it's
background is filled with a bitmap of someone's signature - it goes on the
last page in the bottom-right corner to "sign" a document. Our users "apply
a signature to the document" by clicking a little macro button that does
[essentially] this:
Dim objYouWereHere as Range
Set objYouWereHere = Selection.Range
Application.ScreenUpdating = False
'Physically move to the "last page"
Selection.EndKey Unit:=wdStory
'Position the signature textbox
With ActiveDocument.Shapes("SignatureBox")
.Top = 536
.Left = 231
End With
'Return my user to wherever they were prior to running the macro
objYouWereHere.Select
Application.ScreenUpdating = True
I'm not well versed enough in word/vba to know the answer to this; but is it
possible to programatically define the last page (maybe as a range?) in such
a way that I could insert a shape onto it at an x, y coordinate relative to
that page **without** having to move the selection? With the above
methodology, the user does end up at wherever they were prior to running the
macro, but the objYouWereHere.Select call can sometimes leave them at a new
vertical scroll position and it's a little disorienting for them.
So, before I go hunting down how to store & retreive the vertical scroll
position (similar to how I store and retrieve the selection pre & post
textbox adjustment)... is there a more "elegant" way to do this that doesn't
require I move the selection at all? Insert shape at x, y on page n,
without involving the Selection?