TextBox control not enabled with protection on

This has weird behavior, so I am sure it is a bug.

I am trying to auto-total table columns in a document template (not a VBA 
form).  The fields are ActiveX textboxes and in VBA I simply assign them to 
integers and total; ie effectively adding the values in TextBox1, Textbox2 
etc to total in TextBox9.

Then I assign the "Filling in forms" protection to the document.  

It works fine and dandy in the template (dotm) that I am creating, but it 
all goes wrong when I create a docm from it (which is of course what I want 
the users to do).

When you open up a document from the template (setting the Option to allow 
content), the non-enterable stuff is protected OK, but the textbox fields 
appear like they are editable; that is, they have expansion handles around 
the edges.  But they are not enterable.

Now here's the really odd part.  If I take off the protection and then 
immediately apply it again, all is well - the textboxes are enterable (the 
handles disappear) and the totalling works fine.  

Of course, there is no way I can instruct the users to do this, otherwise 
what is the point of making the document protected in the first place. 

Note that I have populated ActiveX ComboBoxes successfully with VBA in 
another protected document, so I can't think it is a compatibility problem.  
0
Utf
6/2/2010 2:44:01 AM
word.vba.general 1023 articles. 1 followers. Follow

1 Replies
1023 Views

Similar Articles

[PageSpeed] 33

If the handles are visible this suggests you are in Design mode.  I do not
know about 2007, but it may be the same as 2003.

   ActiveDocument.ToggleFormsDesign


tikouka wrote:
>This has weird behavior, so I am sure it is a bug.
>
>I am trying to auto-total table columns in a document template (not a VBA 
>form).  The fields are ActiveX textboxes and in VBA I simply assign them to 
>integers and total; ie effectively adding the values in TextBox1, Textbox2 
>etc to total in TextBox9.
>
>Then I assign the "Filling in forms" protection to the document.  
>
>It works fine and dandy in the template (dotm) that I am creating, but it 
>all goes wrong when I create a docm from it (which is of course what I want 
>the users to do).
>
>When you open up a document from the template (setting the Option to allow 
>content), the non-enterable stuff is protected OK, but the textbox fields 
>appear like they are editable; that is, they have expansion handles around 
>the edges.  But they are not enterable.
>
>Now here's the really odd part.  If I take off the protection and then 
>immediately apply it again, all is well - the textboxes are enterable (the 
>handles disappear) and the totalling works fine.  
>
>Of course, there is no way I can instruct the users to do this, otherwise 
>what is the point of making the document protected in the first place. 
>
>Note that I have populated ActiveX ComboBoxes successfully with VBA in 
>another protected document, so I can't think it is a compatibility problem.

-- 
Gerry

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/201006/1

0
Fumei2
6/3/2010 6:19:11 PM
Reply:

Similar Artilces:

IWebBrowser2 control in dialog
I have the above mentioned control in a dialog and would like to remove the vertical scrollbar from the dialog. If I resize the dialog the vertical scollbar becomes disabled but I would like it to disappear completely. I've tried: cs.style &= ~WS_VSCROLL; in the PreCreateWindow() of the dialog but that doesn't work. What's the proper way to do this? Thanks, Drew "Drew" <dam@dam.dam> wrote in message news:%239S1b8HgIHA.5036@TK2MSFTNGP06.phx.gbl... >I have the above mentioned control in a dialog and would like > to remove the vertical scrollbar fro...

Sheet Protection
I am trying to protect specific rows and columns on a worksheet. I select all, go to protection and uncheck the locked cells box. Then highlight the rows and columns I want protected, go back in to lock the cells via right click>format cells and it tells me "Cannot change part of a merged cell." what am I doing wrong here? As far as I can see what you are doing is right. I have just checked what you have done in EXCEL 2007 and do not get the same warning: it works for me. Where are the merged cells? In the protected range or out of it? I tested with both a...

password protect outlook 2007
hi I tried to put password on pst file to lock up the outlook but everytime I open outlook, it dosen't ask me for the password how can I add the password to outlook so that even when I logon to the computer outlook will still ask for password to open? (under windows vista) thanks That usually means that Outlook did not close correctly. Use task = manager to kill all Outlook.exe processes. Some common reasons why Outlook will not shut down completely when you = click either the X or Exit: 1. PDA synchronization software with your PDA in the cradle. 2. WinFax Pro (especially 10.02 ...

Unable to enable password for PST file
Using Outlook 2002 with pop email account and fax receiving system. If I enable password for data file (pst), outlook doesn't prompt me for password on startup. Any ideas? Tom in VT Does Outlook close completely on this machine? Use task manager to verify. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the Swen virus, all e-mails sent to my actual account will be deleted w/out reading. After searching google.groups.com and finding no answer Tom <tsa68@adelphia.net> asked: | Using Outlook 2002 with pop email account and...

password protected file with pivot table errors
Hey friends, We have a big problem, around 20% of the times we save workbooks with pivot tables inside and protect them with password for opening the file - the file get ruined! In those times, when we open the file (the password protected file with the tables inside), excel ask me for the pass (ok, I give it) and then say "file opening did not succeeded", and then let me type again, in the second time it opens but give a message saying "there where errors in the file, and changes where made:" (and then a list of my pivot tables saying that fixes made to them). Fr...

OLE control does'nt work with dll
Hello, The exe program does very well when inserting an Excel range from Excel in an OLe control in a vb6 form, with: XlApp.Range(xxx).Copy me.OLE1.Paste But when the exactly same program is executed as a dll, the OLE control resizes itself but does'nt display the Excel range. No error is fired Any help Thanks Avi ...

What controls what appears in the Title Bar?
I have a user who usually runs Outlook 2007 with several calendars open: her own, and calendars of two other people in her department If she has only her own calendar open the title bar says 'Calendar - Microsoft Outlook'. If she has these shared calendars open, the title bar shows the name of one of the people who's calendar she has open, i.e. 'Bob Smith - Microsoft Outlook' She would like the title bar to display 'Calendar - Microsoft Outlook' all the time, regardless of who's calendar she has open. Can this be done? Thanks, Jim By the way, our back...

How to release a CWebBrowser2 control?
Dear everyone: I have a CWebBrowser2 control on my dialog and navigate to url by the following code: CComVariant sNull,sFrame; sNull=""; sFrame=""; m_ctlWeb.Navigate("http://www.microsoft.com", &sNull, &sFrame,&sNull,&sNull); When I close the dialog and try to release the control by the following code: m_ctlWeb.DestroyWindow(); The control is destroyed, but when I check the task manager for the memory usage, I found that a memory of over 11 megebytes still remained! Can anyone tell me how to release the memo...

No Sound no volume control in notification area
I updated to a new driver from Windows and my sound is gone and the volume control icon by the clock is gone. I tried to roll back but no drivers to roll back too. System restore also did not work. Shoots. What now? This is not a Windows group. Do not upgrade a driver from the Microsoft web site. Go to the manufacturer's web page and get the update there. Have you re-booted? -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "RiderDubs" <RiderDubs@discussions.microsoft.com> wrote in message news:D617B57B-6C3...

Move Control to another Form Problem
This Control Button I want to move from my MainMenu Form to the form that contains the the List Box [lstModify], which is where my Invoices sit to be distributed, When I moved the control I got a yellow error on {subSetInvoiceValues} thanks for any help......BobPrivate Sub cmdDistributeAllInvoices_Click() Dim nRtnValue As Integer nRtnValue = MsgBox("Are you sure you want to Distribute All Invoices?" & vbCrLf & vbCrLf & "If you choose Yes, all the Invoices will have Invoice Numbers.", vbCritical + vbYesNo + vbDefaultButton2, "Distribute all Invoices"...

Controlling decimal digits
Hi I have a few numeric hours appear on a report like this; 2 9.75 12.5 This is all fine but when a number like 1.83333 appears I only would like it to limit to two decimal places as 1.83. How can I achieve this? Thanks Regards On Mon, 1 Mar 2010 06:48:35 -0000, "John" <info@nospam.infovis.co.uk> wrote: >Hi > >I have a few numeric hours appear on a report like this; > > 2 > 9.75 > 12.5 > >This is all fine but when a number like 1.83333 appears I only would like it >to limit to two decimal p...

Preventing other users saving another version of protected workboo
I have protected a workbook with locked cells and unlocked cells that can be edited. I would like to prevent the user from "saving as" and abusing the protection. Is this possible? Saving As will not alter the protection. "Laura Cook" <laura.cook@strand.ltd.uk.(nospam)> wrote in message news:B8ED3CA2-108C-48D3-8D08-FA233E136A7B@microsoft.com... >I have protected a workbook with locked cells and unlocked cells that can >be > edited. I would like to prevent the user from "saving as" and abusing the > protection. Is this possible? ...

Hosting windowless control
I have a windowless control - it has to be windowless because it's not rectangular. I have used it many times in VB applications without problem. Recently I tried to include it in an MFC dialog box and it doesn't work. It appears to be being drawn with a control window. What happens is that MFC blanks the rectangular area of the control site to white before invoking the control's draw function. Debugging through the control (which is ATL), I have discovered that when the host is a VB application it is, indeed, windowless (control's bWndLess member = TRUE) but when hosted fr...

Scrolling a static control?
Given a narrow "static" control on a dialog, it's text can be set using SetWindowText("Some looong text here...."). That same long text can be retrieved with GetWindowText(). What's missing is the ability to select the text while holding down the left mouse button. Enabling the SS_NOTIFY style on the control itself will notify the parent of things like WM_LBUTTONDOWN, WM_MOUSEMOVE, and WM_LBUTTONUP messages, but can anything be done to scroll and select the text? Thanks, DC You cannot do that with a static control. An alternative is to use a CEditBox control ...

tab control problem
I set up a series of automated tabs. Ex. user hits a button, focus shifts to an unbound box in a tab. That unbound box has a "on focus" macro that goes to an unbound box on a second tab, which has a "on focus" macro that shifts focus to a third unbound box on a third tab, etc. The problem becomes when I have more than one leap, an error message comes up saying that I cannot change focus to the 1st unbound box. The error message appears for every box in tries to access, but the focus ends up where I want it to be. My question is: was does it says this, but work anyways? ...

Stop sheet showing when Using Datapig's Force Users to enable macr
Hi, I think this is probably not do-able I'm using Datapig Technologies example to force users to enable macros When the workbook is closed all sheets other than a warning sheet are very hidden so that if the workbook is opened with macros disabled then the user can only see a warning sheet saying to close and open with macros enabled. Then on opening with macros enabled the waring sheet is very hidden and the other sheets can be seen. Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.ScreenUpdating = False Sheets("Warning").Visible = True Sh...

Stock control question
Although I have used Excel for years I have never had the need to use a complicated formula. I am trying to set up a stock control spreadsheet where multiple items are deducted when I click on one cell. What I am trying to do is each time I click on cell A3 "Item" all the amounts in C will be deducted from D and the difference between B and D will show in E A B C D E 1 Normal Amount In stock To be 2 Stock level...

resize textbox
Hi there, I'm struggling to resize the textbox on the MS CRM form. for instance initial field- max 2 characters.Can anyone help. Thanks in advance -- donn Go to attributes and edit the Max Length value of the textbox in question. Regards Steve "Donald" wrote: > Hi there, I'm struggling to resize the textbox on the MS CRM form. for > instance initial field- max 2 characters.Can anyone help. Thanks in advance > -- > donn I'd like to make a quick mention here about past experience with resizing text boxes. If you are inserting data from .NET applicatio...

Prompt to save when using a tab control
Hi there In my database, I have a form which consists of 5 tabs. When a user moves from tab to tab, is it possible to set a prompt that prompts the user to save their work? I have users who think that this is a necessary feature of my database. Thank you in advance for your help. On Sun, 21 Mar 2010 17:29:01 -0700, forest8 <forest8@discussions.microsoft.com> wrote: >Hi there > >In my database, I have a form which consists of 5 tabs. > >When a user moves from tab to tab, is it possible to set a prompt that >prompts the user to save their wor...

CScrollView within an ActiveX Control
I am trying to create a CScrollView and make it a child in an ActiveX Control. 1) I used the VC++ "Add Class" to derive from CScrollView, getting MyScrollView 2) #include'd the header file and delcared a member of that derived class "MyScrollView m_View" 3) When I attempt to create it, the compiler tells me that I can not call the "protected" construtor. I then tryed to create the derived class via a "new" , dynamically. Got the same error. and Ideas? PinHead wrote: > I am trying to create a CScrollView and make it a child in an ActiveX &...

Protect or Unprotect Cell dependent on different cell
I am trying to find a way of automatically protecting a cell if an adjacent cell has a specific value whilst if that cell has a different value the cell would be unprotected. For example if I am aiming to have a column with values in that will be entered but if a field next to it has a 1 in the value field will then be locked. But if the 1 is changed to a 0 the value field could then be edited. Many Thanks for any help. David You could do this with a worksheet_change event to make it fully automatic.Unlock ccell f1>protect the sheet>right click sheet tab>view ...

Updating dialog controls
Hi, I have a SDI application written with Visual C++ 6. The view is a CFormView. The first dialog in the CFormView has CTabCtrl to switch between dialogs. When I open a file, I want that the data ,in this file, to be put in the differents controls of all of the dialogs. But I don't know how to do this. I think I have to do this in the CFormView OnUpdate member function. I have tried also mTab.UpdateData(FALSE), but without success. Does anyone has suggestions ? Thanks, Claude Claude Gagnon wrote: > Hi, > > I have a SDI application written with Visual C++ 6. > >...

Re: protecting worksheet corrupts file
I have tried several different methods including: ActiveWorkbook.Protect "Password" Dim objSheet As Worksheet For Each objSheet In Worksheets If objSheet.ProtectContents = False Then objSheet.Protect "a@#&ladfl&^" Next objSheet or With ActiveSheet .EnableSelection = xlUnlockedCells .Protect Contents:=True, Password:="Password" End With or ActiveSheet.Protect UserInterfaceOnly:=True, Password:="Password" even just ActiveSheet.Protect Password:="Password" Nothing works, I have macros that need to have ...

can you control how comments print in excel xp or 2003?
I noticed a user at the copier today, using the blow up function to try to enlarge the comments that he had printed out at the end of his excel worksheet. He commented that he could not change the font for the comments. I went back to my desk, and was able to replicate the issue... In short, you can format comments for on-screen viewing (and presumably when you print comments "in place"), but if you print out all the comments at the end of your document, you apparently can't control the font/size/formatting/etc. The only thing I could find that made a different to how it printed...

How to password protect a webpage in publisher
I have a website built and published with Publisher and want to password protect a page on the site. How do I do this using Publisher. Thanks in advance -- Wayne Edgin Step one: Verify with your ISP that it is allowed. I can tell you how I do it with a Publisher 2000 site. Post your Publisher version and site address. -- Don Vancouver, USA "Wayne" <Wayne@discussions.microsoft.com> wrote in message news:299AAF1E-73F0-4ABB-91CD-74ED83297996@microsoft.com... >I have a website built and published with Publisher and want to password > protect a page on the site. How...