Word cannot undo this action. Do you want to continue? - vba

I have a document into which I copy all kinds of VBA code regarding questions asked on this site and write code in preparation for answers. This document was created on my PC (with Word 2010). It has no event procedure that runs on the Save event, but at some point a few weeks back it started to ask me the above question before every save, including automatic saves. The document is based on the Normal template which has no code in it. I don't know which code may have caused this to start, nor which code to even suspect. Other documents open in the same instance of Word save normally. It's only this one document that is affected.
The document also contains a lot of special items, like content controls, fields, ActiveX controls, EndNotes, tables and comments. I suspect the comments to be related to this problem in some way.
I know that I could probably stop the alerts by disabling alerts but that isn't what I want. I want Word to display all the normal alerts. It's just this abnormal one which I would like to switch off. Any ideas how to do that? Or what caused Word to issue that alert in the first place?

In these situations I make several backups of the document and then start looking for something that is broken. So using a new backup each time, I systematically delete portions of the document to see if the unwanted / unexpected behavior disappears. For example I first try to isolate the issue to the top of bottom 1/2 of the document. If I can establish that the issue is related to the bottom half then I delete half of the bottom half of the document and so on... it can take a while but it has been an effective method of finding issues for me.
That said, I tried this on a document recently and just ended up going round in circles. I thought I had narrowed the issue down to a single corrupt image, but that turned out to be NOT the case.
I've also found that there are some things that I can do with VBA that Word simply can NOT undo... I'm only aware of a few things (which I'd have to look up in my notes) but I'm sure there's a whole list of things.
A possible workaround might be to clear the undo history for this specific document prior to saving, I imagine that will suppress the message and save you from losing the standard notifications. Hope it helps :)
Good luck!

Related

MS Office Word macro, play sound upon scrolling through certain pages

I've already got the useful tip of how to play an external audio file.
And now I'm struggling of how to use it upon reaching a certain page.
I've managed to find that I have to add the stuff below to obtain a list of events I can use:
Public WithEvents App As Word.Application
And I got a plenty of the events:
App events
But no one from them seems corresponding to what I need.
1)Find out a certain event I can use, to track any action which might change currently viewed page(mouse scroll, arrows, page up/down, mouse move with selection, or any of others..) and then paste a checking function into.
2)The checking function supposed to obtain number of current page within the document(or it's equivalent) and if we are at a certain page play corresponding sound.
There are 2 main problems I've struggled with, but got no good idea.
I also aware that we can use ActiveX object and insert an audio file into the document, it allows to even not keep the file somewhere, but embeed it into the doc.
However here I even have no idea of how to trigger playing of the file through VBA.
But if somebody can advise about it would be perfect because it even more handy, in terms of maintenance(no need to keep external audio files).
Any help is appreciated.
If you know that it's impossible in general, please also let me know, so I can close the topic.

Excel ActiveX controls changing size with resolution still not fixed?

OK, this might be a bit of a generic and repeated non-code question but the latest article I can find about this is from over 2 years ago, so I'm wondering if there's been a fix or an update or maybe some clever dude out there has cracked the secret to curing this.
Every time I extend my screen while Excel (2007, 2010 or 2013) is running, and every time I unplug from an extension while Excel is running, my ActiveX controls are rendered useless, because with each click they either shrink or get bigger, depending on if I extended or unplugged.
This happens until I close the Excel application and restart it, unfortunately if I've saved it while the buttons are bigger/smaller they might end up stuck like that.
There is a thread here which has a bit code to help deal with the issue but quite frankly I'm hoping by now, two years later, someone has a slightly more efficient method of dealing with it.
I've took to using hyperlinks to run macros now but that's no good for my drop-boxes and things. And for me personally, I can just make sure I close Excel before extending/unplugging, but the real issue is I'm developing apps for people around the company and it's starting to cause problems with these damned buttons.
Does anyone know of a definitive fix for this yet?
If you only need ActiveX buttons to run macros, use Shapes instead. You can assign macros to a s shape's Click event. Right-click the shape and select "Assign Macro".

Notes 9 crashes while editing external email

We have a customized mail template where we can set values of a parameter in mail preference.
After getting upgraded to Notes 9, when the parameter is set to Automatic it's working fine, but when another value is selected below thing happens (It was working fine in previous versions of Notes..):
After opening any external email, after double clicking on the mail body to edit.. notes is getting crashed.
I have two questions :
I see for external emails the control is going from querymodechange to queryclose while editing. Does it always happen?
I debugged the whole thing. Surprisingly it works in debug mode..no notes crash!!
Any help would be much appreciated !!!
This is why customizing the mail template is rarely recommended. There are interactions and dependencies between the code in the template and the Notes client, and it's very hard to debug. Since you haven't shown any of your customized code, I don't think anybody is going to be able to help you. I would recommend removing your customization code one piece at a time until it no longer crashes. Then you'll have an idea of what's triggering it, and you can try a different approach.
When Notes crashes, it dumps some diagnostics in the data/IBM_TECHNICAL_SUPPORT directory, notably the file console.log
You could review it and post here the lines pertaining to the crash.
Also, what was the previous version of Notes ?
To target the offending code line, you can use that old, dirty and tedious trick : add the folling line at the top of the QueryClose event, and move it down until you no longer see the result. Then post the context.
print now & "so far so good"

Form designer only shows the form in vb.net

I was working at the forms designer and yesterday the designer literally only showed the form. Tried copying the .designer.vb to another new form and the same thing happened. Also when built it just shows what the designer shows. Compare the two versions:
(Had to use pastebin as the code is too long for a post, and it rejects my post if more than two links are used.)
Current code: pastebin.com/SsgR7YWD
Current form view:
Previous code: pastebin.com/bXCL3jhH
Previous screenshot:
Why it is not showing the controls? I know it is a long piece of designer code but I can't find where the error comes from.
I've just run your code through this site that compares to blocks of text and shows the differences - there's a lot - you might want to do the same and have a look at the differences. It may be easier to delete the form and start again to be honest. Having said that, you might be able to spot what went wrong
You should just delete the form and start again. A few tips to having a better UI ---
Use layout grids for the button-checkboxes and let the buttons occupy the whole horizontal space.
And remember to backup your code often so that things like this won't happen again - use something like GitHub and commit your files whenever your day is finished.
Happy coding!

I'd like to preview a Word document on form

Update2: For now, I'm considering saving a temporary copy of the document in html format to display it, but this kills my idea to show the user's real time affect on the document. It's just bad practice to re-save at every character input and reload the browser. So, I suppose this may just be impractical for now. I'll keep my ear to this thread for any answers that might arise. Thank you for your help.
Update1: The WebBrowser works for PDF, but not Word Documents for some reason. Instead of displaying in the browser control, it opens the document in word. This is apparently something having to do with file to program association within the operating system, but I'm programming this to work on machines besides my own. Therefore, I'll either need a work around, or a way to change the setting programmatically.
Interestingly, when I right click on a doc file, click Open With, and select Internet Explorer, it opens Word.
Original Question:
I'm writing a VB program that fills in
values within a word document. I'm
utilizing the Microsoft Word 12.0
Object Library as a Reference.
I'd like to provide a scrollable preview pane to my user that is within
the form he or she is using. It
would be even cooler if the user could
edit the document through this pane.
I've done Interop extensively, so I'm
well aware of how to write and edit a
Word document. I just want to put it
into a frame and preview it. I'll
probably try to select around the
document based on what is changing as
the user provides input so they can
see what's being changed and where.
Thoughts?
Thanks
Would the print preview not do this?
Edit: Removed previous answer since it's not recommended by MS.
This article talks about using the WebBrowser control to open OFfice documents instead
http://support.microsoft.com/kb/304643/
Okay, I'm answering my own question, but leveling up those that tried to answer. I've decided that the best solution is to actually open the word document, but keep my form's TopMost property set to True. Then, I can doc my form in the upper right, display the document being edited behind it, and select around to each point being manipulated. This effectively accomplishes what I was after.
Thank you to those that provided answers here. They led me to learn quite a bit of stuff.