WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Graphics inserted into a Word2003 table cell shrink!

 
   Home -> Office -> Tables RSS
Next:  Politics  
Author Message
Lenny

External


Since: May 23, 2006
Posts: 73



(Msg. 1) Posted: Fri Oct 03, 2008 9:09 am
Post subject: Graphics inserted into a Word2003 table cell shrink!
Archived from groups: microsoft>public>word>tables (more info?)

Am working a Word2003 protected form template. Users want to be able to
insert a graphic representation of their signature into a 'signature' block
on the template. Each user will have a graphic file of their signature named
"MySignature" (for testing purposes it is a .jpg) to place in their "My
Documents" folder. When they click on a check box with an 'on entry' macro,
the code unlocks the form, goes to the signature cell bookmarked as
"Signature", opens the employees "My Documents" folder and selects and
inserts their signature, then relocks the file.

The code runs well, except the size of the inserted image changes (gets very
small). If I copy and paste the same image, or insert picture from file into
the same cell with the file unlocked, it copies in at the correct size. I
have checked the cells properties but cannot find a reason for the reduced
size of the graphic.... does anyone have any ideas? Help is really
appreciated. Regards - Lenny

See code below:

Dim objFSO As Object
Dim objShell As Object
Dim objFolder As Object
Dim objFolderItem As Object
Dim strPath As String

Const MY_DOCUMENTS = &H5&
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(MY_DOCUMENTS)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path

ActiveDocument.Unprotect Password:="test"
Selection.GoTo What:=wdGoToBookmark, Name:="Signature"
Selection.Find.ClearFormatting
Selection.InlineShapes.AddPicture FileName:= _
strPath & "\MySignature.jpg", _
LinkToFile:=False, SaveWithDocument:=True
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True, Password:="test"
MsgBox "The document is locked."
End If
End Sub
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Tables All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET