Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Insert picture in a form table
I have a table with some form and dropdown form fields in it. Of course, for
them to work properly the form must be protected. The problem and question I have is that I also want to be able to put a picture in an unused blank cell of the table but can't while it is protected. Can I do that and if so, how? Thank you. |
#2
|
|||
|
|||
What you'll need to do is write a VBA sub procedure that
unlocks/relocks the form. Then between the calls to toggle the locking...you can either add a recorded Insert Picture procedure to allow the user to enter the picture, or you can record on yourself and leave the path/image as a variable (blank). You can then use an input box or common dialog box call to allow the user to search for their image at that point. You might want to check out this TechTrax article which shows how to record a macro to insert an image into letterhead. And the second one shows how to capture information from a user. Finally, you can find many more free forms tutorials on my site at the third URL: Adding/Removing Stationery Logos Thru Automation http://pubs.logicalexpressions.com/P...cle.asp?ID=528 Pass Repeated Information in a Word Document http://www.computorcompanion.com/LPMArticle.asp?ID=224 Free Word AutoForm Tutorials http://www.mousetrax.com/techpage.html#autoforms To get you started, here's the Protection toggle sub procedure you can use: Sub ToggleFormLock() '********************** 'PURPOSE 'quickly checks form state and toggles open/close Protection ' as needed to enter data. '********************** 'if locked, unlock, else lock If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then ActiveDocument.Unprotect Else ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _ NoReset:=True End If End Sub Hope this helps... Dian D. Chapman, Technical Consultant Microsoft MVP, MOS Certified Editor/TechTrax Ezine Free MS Tutorials: http://www.mousetrax.com/techtrax Free Word eBook: http://www.mousetrax.com/books.html Optimize your business docs: http://www.mousetrax.com/consulting Learn VBA the easy way: http://www.mousetrax.com/techcourses.html On Mon, 18 Apr 2005 13:01:01 -0700, "Wylie C" wrote: I have a table with some form and dropdown form fields in it. Of course, for them to work properly the form must be protected. The problem and question I have is that I also want to be able to put a picture in an unused blank cell of the table but can't while it is protected. Can I do that and if so, how? Thank you. |
#3
|
|||
|
|||
I noticed several requests over the last month or so for a method of
inserting a picture into a protected form. I've prepared a sample template with the macro code required to do it. You can download it from http://jay-freedman.info/form_picture.zip. If you have any questions about it, please post here or email me at the address in the template. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org On Thu, 21 Apr 2005 17:45:24 -0500, "Dian D. Chapman, MVP" wrote: What you'll need to do is write a VBA sub procedure that unlocks/relocks the form. Then between the calls to toggle the locking...you can either add a recorded Insert Picture procedure to allow the user to enter the picture, or you can record on yourself and leave the path/image as a variable (blank). You can then use an input box or common dialog box call to allow the user to search for their image at that point. You might want to check out this TechTrax article which shows how to record a macro to insert an image into letterhead. And the second one shows how to capture information from a user. Finally, you can find many more free forms tutorials on my site at the third URL: Adding/Removing Stationery Logos Thru Automation http://pubs.logicalexpressions.com/P...cle.asp?ID=528 Pass Repeated Information in a Word Document http://www.computorcompanion.com/LPMArticle.asp?ID=224 Free Word AutoForm Tutorials http://www.mousetrax.com/techpage.html#autoforms To get you started, here's the Protection toggle sub procedure you can use: Sub ToggleFormLock() '********************** 'PURPOSE 'quickly checks form state and toggles open/close Protection ' as needed to enter data. '********************** 'if locked, unlock, else lock If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then ActiveDocument.Unprotect Else ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _ NoReset:=True End If End Sub Hope this helps... Dian D. Chapman, Technical Consultant Microsoft MVP, MOS Certified Editor/TechTrax Ezine Free MS Tutorials: http://www.mousetrax.com/techtrax Free Word eBook: http://www.mousetrax.com/books.html Optimize your business docs: http://www.mousetrax.com/consulting Learn VBA the easy way: http://www.mousetrax.com/techcourses.html On Mon, 18 Apr 2005 13:01:01 -0700, "Wylie C" wrote: I have a table with some form and dropdown form fields in it. Of course, for them to work properly the form must be protected. The problem and question I have is that I also want to be able to put a picture in an unused blank cell of the table but can't while it is protected. Can I do that and if so, how? Thank you. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org |
#4
|
|||
|
|||
HA...I noticed the same thing, Jay...and was working on an article,
too. ;-) Dian ~ On Sun, 01 May 2005 18:11:39 -0400, Jay Freedman wrote: I noticed several requests over the last month or so for a method of inserting a picture into a protected form. I've prepared a sample template with the macro code required to do it. You can download it from http://jay-freedman.info/form_picture.zip. If you have any questions about it, please post here or email me at the address in the template. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org On Thu, 21 Apr 2005 17:45:24 -0500, "Dian D. Chapman, MVP" wrote: What you'll need to do is write a VBA sub procedure that unlocks/relocks the form. Then between the calls to toggle the locking...you can either add a recorded Insert Picture procedure to allow the user to enter the picture, or you can record on yourself and leave the path/image as a variable (blank). You can then use an input box or common dialog box call to allow the user to search for their image at that point. You might want to check out this TechTrax article which shows how to record a macro to insert an image into letterhead. And the second one shows how to capture information from a user. Finally, you can find many more free forms tutorials on my site at the third URL: Adding/Removing Stationery Logos Thru Automation http://pubs.logicalexpressions.com/P...cle.asp?ID=528 Pass Repeated Information in a Word Document http://www.computorcompanion.com/LPMArticle.asp?ID=224 Free Word AutoForm Tutorials http://www.mousetrax.com/techpage.html#autoforms To get you started, here's the Protection toggle sub procedure you can use: Sub ToggleFormLock() '********************** 'PURPOSE 'quickly checks form state and toggles open/close Protection ' as needed to enter data. '********************** 'if locked, unlock, else lock If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then ActiveDocument.Unprotect Else ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _ NoReset:=True End If End Sub Hope this helps... Dian D. Chapman, Technical Consultant Microsoft MVP, MOS Certified Editor/TechTrax Ezine Free MS Tutorials: http://www.mousetrax.com/techtrax Free Word eBook: http://www.mousetrax.com/books.html Optimize your business docs: http://www.mousetrax.com/consulting Learn VBA the easy way: http://www.mousetrax.com/techcourses.html On Mon, 18 Apr 2005 13:01:01 -0700, "Wylie C" wrote: I have a table with some form and dropdown form fields in it. Of course, for them to work properly the form must be protected. The problem and question I have is that I also want to be able to put a picture in an unused blank cell of the table but can't while it is protected. Can I do that and if so, how? Thank you. |
#5
|
|||
|
|||
You're welcome to use the template if you want, or send me what you
have and I can finish the article. Happy to do it! -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org On Sun, 01 May 2005 20:02:16 -0500, "Dian D. Chapman, MVP" wrote: HA...I noticed the same thing, Jay...and was working on an article, too. ;-) Dian ~ On Sun, 01 May 2005 18:11:39 -0400, Jay Freedman wrote: I noticed several requests over the last month or so for a method of inserting a picture into a protected form. I've prepared a sample template with the macro code required to do it. You can download it from http://jay-freedman.info/form_picture.zip. If you have any questions about it, please post here or email me at the address in the template. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org On Thu, 21 Apr 2005 17:45:24 -0500, "Dian D. Chapman, MVP" wrote: What you'll need to do is write a VBA sub procedure that unlocks/relocks the form. Then between the calls to toggle the locking...you can either add a recorded Insert Picture procedure to allow the user to enter the picture, or you can record on yourself and leave the path/image as a variable (blank). You can then use an input box or common dialog box call to allow the user to search for their image at that point. You might want to check out this TechTrax article which shows how to record a macro to insert an image into letterhead. And the second one shows how to capture information from a user. Finally, you can find many more free forms tutorials on my site at the third URL: Adding/Removing Stationery Logos Thru Automation http://pubs.logicalexpressions.com/P...cle.asp?ID=528 Pass Repeated Information in a Word Document http://www.computorcompanion.com/LPMArticle.asp?ID=224 Free Word AutoForm Tutorials http://www.mousetrax.com/techpage.html#autoforms To get you started, here's the Protection toggle sub procedure you can use: Sub ToggleFormLock() '********************** 'PURPOSE 'quickly checks form state and toggles open/close Protection ' as needed to enter data. '********************** 'if locked, unlock, else lock If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then ActiveDocument.Unprotect Else ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _ NoReset:=True End If End Sub Hope this helps... Dian D. Chapman, Technical Consultant Microsoft MVP, MOS Certified Editor/TechTrax Ezine Free MS Tutorials: http://www.mousetrax.com/techtrax Free Word eBook: http://www.mousetrax.com/books.html Optimize your business docs: http://www.mousetrax.com/consulting Learn VBA the easy way: http://www.mousetrax.com/techcourses.html On Mon, 18 Apr 2005 13:01:01 -0700, "Wylie C" wrote: I have a table with some form and dropdown form fields in it. Of course, for them to work properly the form must be protected. The problem and question I have is that I also want to be able to put a picture in an unused blank cell of the table but can't while it is protected. Can I do that and if so, how? Thank you. |
#6
|
|||
|
|||
Well...since TechTrax is on hiatus, it's more of an outline for now.
But when it's time to make it more...I'll be in touch if you'd care to share the spotlight with me so I can openly thank you for your sample and code? In the meantime...DON'T wait for me cos' I'm trying not to think much about publishing right now since we're on break. So if you toss it to MVPs.org, I'll like to it if that's cool. We'll talk. ;-) And thanks! Dian ~ On Sun, 01 May 2005 21:35:45 -0400, Jay Freedman wrote: You're welcome to use the template if you want, or send me what you have and I can finish the article. Happy to do it! |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create an insert picture button/control for word forms? | Microsoft Word Help | |||
Table AutoFormats vs. Table Styles confusion | Tables | |||
How do I insert Excel data as a Word table and stay within margins | Tables | |||
Using VBA to Add Table Row to Form Table | Tables | |||
How do I insert a picture into a cell of a table? | Tables |