Wait macro in Word 2010

I must be missing something really simple.  I am just trying to create a Word 2010 Macro that waits for a specified number of seconds before continuing. However I can't see how to do that in Word.  The VBA Command: Application.Wait does not seem
to exist in Word.  Any hints?

You could use the following procedure:
Sub Wait(n As Long)
Dim t As Date
t = Now
Do
DoEvents
Loop Until Now >= DateAdd("s", n, t)
End Sub
Call like this to wait for 10 seconds:
Wait 10
or
Call Wait(10)
Regards, Hans Vogelaar (http://www.eileenslounge.com)

Similar Messages

  • How to remove macros from word 2010 documents?

    I have some .dot files that I'm using as templates for a while.
    They used to have Macros to do some stuff and I started to replace those macros with Add-ins.
    What happens is that the macro menus are still there. I tried to remove the macros (using alt+f8 and even alt+f11) but the custom menus are still there! How do I exactly remove those macros and menus from my .dot files?
    I am using Microsoft Word 2010.

    In addition to what Stefan replied you can also check the attached templates by taking the following steps:
    goto File - Options - Add ins - (Below) Manage : choose templates - in the next dialog click on the template and click remove.
    Maurice

  • List Randomizer Macro for Word 2010

    Way back with Word '97 one of my students wrote a convenient macro for randomizing lists of words.
    Briefly, the list was highlighted and the Macro button (or keystrokes) pushed - and the list was nicely randomized.
    I do not have this Macro anymore and need a similar one for Office 2010 32 bit (MS Word only).
    Note: I am well aware of online randomizers as well as using Excel to randomize a list. However, I wish to eliminate time/energy wasted steps and randomize word lists within Word 2010 itself.
    Any suggestions?

    One approach is:
    Sub Demo()
    Dim Rng As Range, i As Long
    Dim StrIn As String, StrOut As String, StrTmp As String
    Randomize Timer
    Set Rng = Selection.Range
    StrIn = Rng.Text
    StrIn = Trim(StrIn) & " "
    While UBound(Split(StrIn, " ")) > 0
      i = UBound(Split(StrIn, " "))
      StrTmp = Split(StrIn, " ")(Rnd(i)) & " "
      StrOut = StrOut & StrTmp
      StrIn = Replace(StrIn, StrTmp, "")
    Wend
    StrOut = Trim(Trim(StrOut) & " " & StrIn)
    Rng.Text = StrOut
    Rng.Select
    End Sub
    The above assumes a list separated by spaces. For lists separated by paragraph breaks or tabs, insert:
    StrIn = Replace(StrIn, vbCr, " ")
    or:
    StrIn = Replace(StrIn, vbTab, " ")
    before:
    StrIn = Trim(StrIn) & " "
    and insert a corresponding:
    StrOut = Replace(StrOut, " ", vbCr)
    or:
    StrIn = Replace(StrOut, " ", vbTab)
    before:
    Rng.Text = StrOut
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • *.docm CANNOT USE MACROS IN WORD 2010

    Hello everyone
    This is my first post in this community, so if there's anything that is not correct admins please feel free to move the post to where it should be :)
    So I work at an office and there are a lot of users. There is a department in the office which works on files with macros (usually with word, forms with check, radio, text boxes)
    The thing is that when all of the users in the dept. can edit the file and select the buttons, only ONE user cannot use the file. All the macros are disabled or not working...
    Usually when working on a macro document, Word should pop up a security notification and a "Enable content" button, but it's not coming up when opening it from the computer in question.
    Can I have assistance on this? Thanks in advance :)

    Hi,
    Did you check the options in Word on this particular computer? It could be that on this pc the
    message bar has been disabled.
    So have a look at the following settings:
    File - Options - Trust
    Center - Trust Center Settings
    On the next dialog check the settings on [Macro Settings] and on [Message Bar]Compare those settings with a machine where the macro document is working.
    Maurice
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You

  • Acrobat X & XI add-in Word 2010 32-bit cause macro error messages

    When I enable Acrobat COM add-in in Word 2010 32-bit, when I close Word and re-open Word, I receive the following
    This dialog screen pops up three consecutive times after I click on "OK" three consecutive instances.
    The add-in works great in Outlook 2010, Excel 2010, but not in Word 2010.  I manually installed the Trusted Pulisher Certificate for the add-in the the Trusted Publisher store as shown with no success either.
    I went to Word options to the Trust Center and enabled anything pertaining  to macros or scripts and still was NOT successful.  This worked at one time before, prior to Office 2010 updates from Microsoft.  I suspect a Microsoft update may have broken this add-in and may require Adobe to put out an update to fix this.  This worked in January 2013 thru Feb 2013 but now fails with Microsoft Office updates after March 2013.
    Any help would be appreciated!

    Please refer :
    http://helpx.adobe.com/acrobat/kb/troubleshoot-acrobat-pdfmaker-problems-office.html#main_ Troubleshoot_conflicts_with_other_macros_in_Microsoft_Word
    http://office.microsoft.com/en-us/excel-help/enable-or-disable-macros-in-office-files-HA01 0354316.aspx

  • Word 2007 VBA vs Word 2010 VBA - Macro Failure

    Hi,
    I have a macro that when run in Word 2007 VBA works fine (Takes a Word Template, an Excel Spreadsheet and produces PDF output of merged documents).
    Sub mergethem_be() '
    ' merge1record_at_a_time Macro
    Dim fd As FileDialog
    'Create a FileDialog object as a Folder Picker dialog box.
    Set fd = Application.FileDialog(msoFileDialogFolderPicker)
    With fd
    'Use the Show method to display the Folder Picker dialog box and return the user's action.
    'The user pressed the button.
    If .Show = -1 Then
    For Each vrtSelectedItem In .SelectedItems
    'vrtSelectedItem is aString that contains the path of each selected item.
    'You can use any file I/O functions that you want to work with this path.
    'This example displays the path in a message box.
    SelectedPath = vrtSelectedItem
    Next vrtSelectedItem
    Else
    MsgBox ("No Directory Selected. Exiting")
    Exit Sub
    End If
    End With
    'Set the object variable to Nothing.
    Set fd = Nothing
    Application.ScreenUpdating = False
    MainDoc = ActiveDocument.Name
    ChangeFileOpenDirectory SelectedPath
    For i = 1 To ActiveDocument.MailMerge.DataSource.RecordCount
    With ActiveDocument.MailMerge
    .Destination = wdSendToNewDocument
    .SuppressBlankLines = True
    With .DataSource
    .FirstRecord = i
    .LastRecord = i
    .ActiveRecord = i
    docName = .DataFields("naam_mailing").Value & ".pdf"
    End With
    .Execute Pause:=False
    Application.ScreenUpdating = False
    End With
    ActiveDocument.ExportAsFixedFormat OutputFileName:=docName, ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, BitmapMissingFonts:=True, UseISO19005_1:=False
    ActiveDocument.Close SaveChanges:=False
    Next i
    Application.ScreenUpdating = True
    End Sub
    If there are 31 rows in the spreadsheet it produces 31 PDF documents named based on the Name field in the Mail Merge Template.
    However when I use the same Macro code in Word 2010, same mail merge template and same source excel, it produces the first PDF and then generates an error on the bolded line as if there was no longer a document available.
    Now I know I use ActiveDocument.Close before going through the loop again, but that seems fine for Word 2007.
    Am I missing something really obvious here?

    If Bernie's ideas don't work, single step thru the code. Does the first file get created properly?
    What is the error? If the file isn't created, then the ActiveDocument refers to the template which isn't good to close!
    I suspect there is a different behavior in how Word 2010 works and your VBA code probably needs to reflect that, though VBA is usually very good at providing backwards compatibility.
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Word 2010 Macros won't run after installing Outlook 2013

    Here is something I've never run across before.  I'm hoping someone here knows the answer...
    One of my co-workers has Office 2010 Professional installed and has for a year or more been running Word 2010 using a macro that opens a form for additional user input for the document.
    For some reason that I cannot understand at all, he loaded Outlook 2013 and Lync.  After doing this, his Word document will open but he cannot get the macro to execute the command button in the document.  The macro does not fire, so to speak. 
    We have checked the Trust Center and the macro settings are at the lowest level.  Still not working!
    I have tried to simulate this by installing Word 2010 on my workstation where I have a full copy of Office 2013 Professional installed.  Interestingly enough, similar results occur.  I get a security warning that even though my Word 2010 instance
    has macro security set to low, strips out the macro altogether. 
    I'm not all that interested in finding my problem but would like to get some advice on why he is having the problems after just adding Outlook 2013 and Lync.  They may be related .
    Thanks for any assistance.
    Robert Stroud

    Repair did not seem to have any affect on the problem.
    So a bit of clarification - client has 2010 Office Professional including all of the normal packages.  His company updated their machines to Outlook 2013 but did not touch any of the other 2010 packages except Outlook.  They also added Lync. 
    I can duplicate the problem using a 2013 installation of Office Professional and then adding Word 2010 via another installation of Office 2010.  Word 2010 was the only package from 2010 that I installed.
    I have repaired the 2010 installation from the Control Panel.  The Repair Utility does not seem to do anything except force the default .docm to show the Word 2010 icon rather than the 2013 icon.
    If I open my .docm file with Word 2010, I get macro warnings even though the Macro Security is set to enable all macros.
    If I open my .docm in Word 2013, the file executes properly and the macro runs as it should.
    What is it that happens when one or more 2013 packages are installed that breaks the 2010 package macros?
    Robert Stroud

  • RoboHelp 9, Win 7, Word 2010 : Macros not running due to Security Settings

    I've just upgraded from RH7, Win XP, Office 2003,  and cannot get RoboHelp for word to run on new Laptop running Win7 and Word 2010.  By not running I mean the program will start and open Word OK, but try and run any RoboHelp command in a pre existing project and the dreaded "The MAcro cannot be found or has been disabled because of your Macro Security setting" warnign is presented :-
    This is despite settings macro settings appropriately in Word 2010 trust centre :-
    Oddly enough an installation on a Network with Windows 7 starter does not present this as an issue.
    I have Admin rights on both machines, can anyone suggest were else I go and/or what else I can try to cotrrect this issue ?
    Thanks.

    Peter,
    Thanks for the prompt response and usual sage advice.  Firstly in answer to your question this was a 32 Bit version issue.  That I was accessing via a company system account with Admin Privileges.
    Before posting I had reviewed the thread you suggested, after reviewing it again I set about spending another day trying to reslove this issue.  This included, test installations on 2 seperate PC's with Windows 7 (32 Bit) and Office 2010.  Both seperate installations were flawless, so one has to assume there was something wrong with the initial PC.  Back to basics, conducting a system restore on the fault installed PC to a known good point, Completely uninstalling RoboHelp 9 including deleting all templates, file remnants and registry settings. as per Adobe Uninstall instructions (http://kb.adobe.com/cps/881/cpsid_88189.html) , followed this by a complete Windows scan to correct any incorrect file systems / structures, Cleaned registry and created local Administrator account on the PC.  Via the local administrator account conducted a "repair' over Office 2010 to ensure  file structure integrity, Run Word and set Trust centre and file permissions as per the 2 working instructions (Note as I was using some word documents based on word 97 templates I made sure the permissions on those te,plates would run (Un ticked)), conducted clean install of Robohelp 9 and tested.  No longer getting Macro errors. Program running correctly. Re-booted and  Logged back into machine using company account setting, and problem fixed at that location.  (There was concern that company account policy may have been causing the issue)
    As company Sys Admin had initially installed the software I am uncertan as to what machine profile they used.  I suspect s installing under a Local admin profile assisted in correcting the issue.
    As a final step, although the program runs OK in normal mode, I set the start up to always run as "Administrator".  This alters the toolbar options within Word with RoboHelp commands being present via a specific "RoboHelp' Tab rather than grouped in the "Add Ins" tab.
    I know you will also say (As you have advised me some years ago when I raised another issue that you assisted in) that I probably shouldn't be working in RoboHelp for Word and better to be working in HTML, however I dread the thought of migrating what are fairly large projects and staff accessng the final results much prfer the older Help format rather than the CHM or web based formats of now.  From an administrative and distribution viewpoint our environment likes a single file distribution system that the older systems provide.
    Thanks once again for the and direction.  Hopefully other users, should they be confronted with a similar issue find this as some help.
    Regards,
    Bryan Holman
    (Australia)

  • Acrobat X and Word 2010 missing text

    Has anyone found a solution yet to dropping text box text when converting a Word 2010 document via the PDF print driver? There are various posts on this topic but no real solution. Most resolve by using the "Save as Adobe PDF", which works but doesn't solve the actual problem. I have a specific document that we use extensively as a template to create other documents and the text in one text box is consistently clipped off when printing to PDF.
    These are controlled documents done in Word that are kept in a limited access vault and need to be approved. Once approved, I create a PDF and put it in a public location. If I use the Save As option it works fine, except that it has to save the Word document before creating the PDF (why....? I haven't touched it...?). Since I'm working in the vault, the file is Read Only, so I have to browse out to another location, save it and then create the PDF. I get a lot of these and that's a very time consuming side trip, not to mention the extra file management of having to clean up all those files I needlessly created.
    I've tried changing font to Arial, as well as making sure the background is set to No Color. No luck.
    Any help would be greatly appreciated. I had no problems using my Vista machine with Office 2007 and Acrobat 9. They upgraded me to a new machine with Win7, Office 2010 and Acrobat X and all those great improvements seem to have left me less functional.

    Thanks, Bill!
    Coincidentally, I had an AA update come in this morning. I checked Word (yes, it's 32-bit) and downloaded a couple of updates that were waiting (.NET security issues, not sure they're related?). But after the reboot I tried creating a PDF with the Press settings and everything was there. Better yet, I tried again with the standard settings and everything looks good! I verified by converting two or three other documents and everything's fine.
    I thought I was stayingup to date but the latest updates seemed to do it! Thanks for the help!
    Jim

  • PDF conversion from Word 2010 incredibly slow and loses format

    Just moved onto new laptop with Windows 7 Word 2010
    and downloaded Acrobat 9 Pro trial.  Have used Acrobat 8 with Word 2007 and earlier versions with no problems. Now taking half an hour to convert a document and cutting out margins.  Just today I was talking with Adobe tech help and was advised Acrobat 9 is compatible with Word 10.  Any suggestions?

    You should be able to print to the Adobe PDF printer, but nothing else probably will work with OFFICE 2010 as Adobe told you. You probably can just wait until AA10. There are no current expectations of AA9 being updated to work with OFFICE 2010 (at least the PDF Maker part.).

  • The appearence of tables in some Word 2010 documents changes after KB2880529

    I wanted to alert you that, since our company has applied
    KB2880529, some users are reporting Word 2010 documents (docx) having their appearence changed.
    More precisely, the issue concern the table inserted in the Word document : They are all messed up. For exemple, the begining of the table can look ok, then a few lines of the table are
    badly miss aligned (like moved 2 cm to the right), then you've got a few normal lines, then again several bads, and so on.
    Also, some of the cells, that were in the last column of the table, may appear half outside of the table.
    And the worse part is that, even if you take some time to manualy fix the table, when you save the document and re-open it, everything is bad again, and exactly as it was before... so basicaly
    the save doesn't work for the tables (it work if you change some text in the table, but not for the table itself (size of the columns, location of the columns, so on)).
    I can't profite any file because they are of a very sensitive nature and can't leave our company, even if I remove most of the content, our IT security doesn't allow it.
    Anyway :
    - we are absolutly sure it's
    KB2880529 that does that because when we uninstall the KB, and re-open the document, it look normal again.
    - it seems to concern only documents that were created using some old Word 2003 templates some time ago, and then opened in Word 2010. As far as I know it doesn't happens on 100% Word 2010
    documents.
    So, we are currently doing a package installed by SCCM 2012 in order to uninstall it on all the PC which received it a few days ago.
    Let's hope you'll correct that issue... and if possible that, in a near futur, you'll had a feature in SCCM 2012 to allow us to unintall KBs, like it was possible with WSUS.

    I'm sure there are some ways to fix the files one by one. Indeed, our tests indicate that it's possible, for exemple, to open them in "LibreOffice 4.2" (a fork of OpenOffice), which displays them correctly, and then save the file in .doc and then use
    Office 2010 to open this .doc and save it in .docx.
    But what I've forget to indicate is that the issue touch probably thousands of documents that have been placed in a "document management application" (I'm not sure how to correctly translate) over the years, documents that may be hundreds of users need to
    look at, for reference, from time to time... but basicaly the documents are "frozen" / archived, they must not be edited by anybody.
    I very much doubt you can expect MS to not apply updates, including via the next Service Pack, just because some tables in some of your documents are corrupt. Besides which, the same problem will quite likely resurface when you next upgrade to a newer version
    of Office. Ultimately, someone is going to have to check out all the documents with tables and verify their content. The scope of that project might be narrowed down after you've checked a few documents and found some common features between those with the
    corrupt tables. It's easy enough to write a macro to test the files to see which ones have tables. That can serve as the first step in narrowing the scope of the project. It's also possible have the macro that repairs the files restore their
    original time/date stamps if that's important.
    An entirely different approach would be to temporarily uninstall the update on one PC. Then use that PC to convert all the documents to PDF. Then use the PDFs in the "document management application". Since the documents "must not be edited by anybody" the
    PDF format is inherently more secure in that regard and can have security attributes set to prevent printing and/or content copying. The PDF format is also impervious to Word's tendency to change document layouts whenever you do little things like updating
    printers or changing between doc & docx formats.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Custom Property in Microsoft Word 2010 Document Template and Sharepoint 2010 Content Type not Syncing up

    I wrote a macro in a Word 2010 template with a custom property called HeaderFooter (a Yes/No value). When the property is changed to No, the header and footer are hidden, otherwise, the header and footer are displayed.
    I added the template to a SharePoint 2010 Document library, with a content type DocInformation and a column name HeaderFooterOffOn that I want to map to the custom property HeaderFooter in the Word Document.
    The macro isn't working in SharePoint, though, because when the user clicks on the HeaderFooterOffOn in the DIP of the Word Document, the Word Custom Property (HeaderFooter) isn't changing with it.
    How do I get these two synced up, so that when the SharePoint column is changed, the Word Document's custom property simultaneously updates with it?

    Hi kevinkevinc,
    There is no direct way to run macro in SharePoint
    As a workaround, I suggest you use SharePoint Event Receiver to run some custom code when column changed.
    Here is a similiar thread for your reference:
    http://social.msdn.microsoft.com/Forums/office/en-US/249249e2-3263-4001-86fa-bda342d95f35/run-word-macro-on-newly-uploaded-sharepoint-word-documents?forum=sharepointdevelopmentlegacy
    More information:
    SharePoint Event Receiver:
    http://msdn.microsoft.com/en-us/library/ee231563.aspx
    http://msdn.microsoft.com/en-us/library/ff398052.aspx
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

  • Word 2013 generates .docx files that cannot be read on Word 2010

    Howdy,
    I received a MS Word document that was created on Word for Mac 2011.  I opened it, edited it and saved it in .docx format.  I have MS Word 2013 running on a humble PC. 
    Now the Mac cannot read my file.  Also, PC's running Word 2010 cannot read the file.
    However, many different machines running Word 2013 can open the file, Google Docs can open the file, Word in the Cloud can open the file, open office can open the file and even Word 2003 with the compatibility pack can open and edit the file.
    Mac's give an error message that essentially says "xml format incorrect".  PCs simply say the file format is wrong.  No other details.  Various compatibility checks inside word say that everything is compatible with prior versions
    of Word with the exception of my equations which it says will be converted to .gifs if viewed in word 2003.
    Any idea what is going on?  Supposedly, Word 2007, 2010 and 2013 all use the same xml formats, so its a bit of a mystery why 2010 (and 2011 on the Mac) cannot open a standard format .xml file that was created by 2013.
    The file contains text, figures and equations.  Nothing else.  No macros, no VBA code.
    Thoughts or advice? 

    Hi,
    What is the file's original extension? .doc?
    If you saved the file in .docx format by changing the extension directly, the issue may occur, please make sure you saved it by "Save as". Or we can rename the file from ".docx" to the original extension, check if the issue
    persists.
    If it's not your scenario above, we can also try to "repair" the file in Word 2010:
    Open Word 2010, Click File -> Open -> Browse to the file and use "Open and Repair" to open the file.
    If the suggestions above don't help, please provide the exact error message that you get in Word 2010 so that I can perform further research.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Word 2010 with excel links is very slow

    Hi..
    One of our groups uses an word file that has many excel links in it. Ever since we upgraded to office 2010 .docx format the word doc takes forever to open, it seems to get hung on the excel links and it keeps retrying these links until it fails. In the backround
    you see excel being opened and closed many times . sometimes you can wait for 20 minutes for the file to open. If the file has 10 excel linkes and some of those links are bad or even on a different network, it still gets hung on those links and tries to open
    them
    The strange part is if we save the file in 2003 mode (.doc) and try to open it's fine. We are running word 2010 sp1 fully patched.  This happens on all our machine. Somehow word 2010 it not good at quiting when trying to open links..
    help.. thanks

     
    Hi,
    If the option to Update links automatically on open is enabled, then users are going to see some slowness when opening the files because Word is trying to update links.
    Even if the links are set to manual, users may still see some slowness when opening the files.
    You can try the following suggestions to see if it helps. These will need to be set on the machines where the files are being opened.
    (1). Disable the setting for Update automatic links at open.
    To disable the option, in Word, click on File, choose Options.
    Click Advanced.
    Uncheck the option "Update automatic links at open.
    (2). Change the links to be manual instead of Automatic.
    IN the Word document, click File.
    On the right, choose Edit Links to files.
    Change the links in the file to manual if they are set to automatic.
    (3). Look at the following article and try installing the hotfix and applying the registry key listed in the article.
    http://support.microsoft.com/kb/2504009
    Thanks, Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Risa Microsoft
    Online Community Support

  • Bookmarks for Captions in Word 2010 are out of order

    When I create a PDF from within Word 2010 using the Acrobat X PDF Maker, I select the headings and other Word styles I want made into bookmarks. It works fine except for Captions. In the PDF Maker settings I have Captions set at level 5, since that is below all of the headings. The Distiller places all Caption bookmarks near the top of the Bookmarks panel, grouped together. It should place them underneath each heading, in the locations where they are found in the document. For example, Table 5 should be under the Heading for Pricing, where it is in the document. Instead it and all other captions are placed under the Contents or Title Page or another heading near the top of the bookmarks. Acrobat used to do this properly, and it works properly on my coworkers' computers, on the same documents. What is causing this and how can I fix it? It is time consuming to relocate all of the caption bookmarks in a 50-100 page document to their correct place in the bookmarks panel.
    I am using Acrobat X, Word 2010, in Windows 7.
    Thank you!

    While I am still waiting for a response, I'll add that I don't know if this is a Word problem or an Acrobat issue, but I can't find a similar problem in either program's help or community responses. Wondering if I should have my IT dept. re-install Acrobat and/or Word 2010, which is a time-consuming hassle since I no longer have admin rights. Any suggestion would be appreciated. We do enough of these to make it troublesome to correct manually each time, and also a risk in case of error or missing a misplaced bookmark.
    Thanks again!

Maybe you are looking for