I want to run a macro when a document is opened to insert a shared building block

I have a macro called insertsrsheader that I want to run when I open a particular word document.  This macro inserts a shared buidling block document.  What vbs code do I use to get this to run when the document is opened?

The code you posted here doesn't make sense, as Paul has already mentioned. As a guess (I haven't checked) it might have been something like the following:
Application.Templates("F:\Building Blocks\SRS Header.dotx"). _
BuildingBlockEntries("SRS
Header").Insert Where:=Selection.Range, _
        RichText:=True
If so, what you also need is a line before that saying
Application.Templates.LoadBuildingBlocks
Peter Jamieson

Similar Messages

  • I want to run a macro when a document is opened to insert a shared buidling block

    I have a macro called insertsrsheader that I want to run when I open a particular word document.  This macro inserts a shared buidling block document.  What vbs code do I use to get this to run when the document is opened?

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Word, you'd better post your questions to MSDN forum
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=worddev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • Algebra CD keeps displaying "Script run-time error" when I try to open it

    I have a CD that came with my Algebra book (I bought it used) for Technical School and it keeps displaying Scrip run-time error when I try to open it.  I have updated Quick-time player, just in case that was the problem.

    b noir wrote:
    Is CoreGraphics.dll cited in the iTunes events?
    Also check for error events happening a few seconds prior to the iTunes events. Open those events. Do they all cite the same .ttf file? If so, what's the precise spelling of the .ttf (font) file?
    YES! There is a CoreGraphics.dll cited in the iTunes event. This is what exactly the window said
    "Faulting application iTunes.exe, version 9.0.3.15, faulting module CoreGraphics.dll, version 1.0.60.0, fault address 0x00266560."
    For the .ttf file, this is what it showed.
    "Windows cannot access the file C:\WINDOWS\Fonts\ARIALUNI.TTF for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program ARIALUNI.TTF because of this error.
    Program: ARIALUNI.TTF
    File: C:\WINDOWS\Fonts\ARIALUNI.TTF"
    I hope this will help. I still cant open iTunes.

  • In my pc  my  AIR app  run correctly but when i try to open it in other pcs not run correctly

    hi friends
    any one can help me please...
    i had created air app very nice about my school ,so after i build the application and test it in my pc its run correctly without problems, but when i to try open after installed  it
    in other pcs the program not run correctly exactly show me empty window with progress dots like this :
    with my respects

    What are you expecting to display? Is it data? Images?
    It's possible that you've written your code such that it references a path on YOUR specific machine. Always try to avoid references to C:/ or /<yourUserName>/someFolder as you're not guaranteed that they'll exist on other machines.

  • Text editing box becomes inactive when multiple documents are open?

    I have a user that recently has a problem when editing documents.  If he has more than one document open the text editor becomes inactive (greyed out).  It works fine with just one document open still.  Is this 'working as intended' or a glitch in the software.  User is running Adobe Acrobat 9 Standard.  We've tried running a repair on the install but that didn't work.  I haven't yet tried uninstall/reinstall - I'd prefer to get more information on this before we try that.

    The user isn't editing large portions of documents though. 
    More info from the horse's mouth -
    I have used the touchup tool and that is NOT what I want to open up.  I am working with detail Maps.  The touchup tool will open up and attempt to “touchup” the detail of the maps and that is Not what I am doing.  I am using the “polygon” tool and “text box” tool to circle areas on the map and place labels on these areas for our clients.  A simple task of adding lines and text.  These are basic mark up tools Adobe offers. These mark up tools are what I am having problems with.  I do not intend on converting the maps that are already “scaled” and possibly lose that detail.  I explained this to Aaron Rasor as well and he has seen the simple issue.  The Basic Mark up tools ghost out and become unavailable when I have more than 1 document opened at once.

  • X pro crashes when multiple documents are opened

    x pro crashes when multiple documents are opened

    Hi travisc74509405,
    Could you please let me know what version of OS are you using.
    Also, let me know how much RAM and free hard disk space is available on your machine.
    What exact dot version of Acrobat X do you have? You might check for updates under the Help menu to use the latest patch i.e. 10.1.13
    Hope to hear from you.
    Regards,
    ~Anubha

  • AppleWorks Crashing When a Document is Opened

    I am a law student. I have an Apple G4 iBook and use Appleworks 6.2.9. I save all my class as .cwk documents and use an outline format.
    Sometimes, when I go to open those saved documents by double-clicking on the icon, a blank page pops up for a second or two, then the program crashes.
    The document will not do this perminantly and will never open in Appleworks again.
    This is horrendeously inconvenient and can prove to be a big deal come finals time. Please help with any suggestions (other than buying a PC).

    Hello
    Of course, saving a copy in AppleWorks format and an other one in rtf format is a good tip.
    But for those who didn't do that, for WP documents, all is not lost.
    When such a doc appears to be corrupted from AppleWorks 6 point of vue, just drag and drop the doc's icon on TextEdit's icon.
    You will get the file's raw content.
    A bit of cleaning and the raw text will be recovered.
    It appears that there is some checksum tip installed in AW documents.
    Simply change one character in a string content with a file editor like HEXEDIT will make the doc unreadable from AW's point of vue.
    If I remember well, this feature didn't exist in not too recent AW versions.
    I remember that I used HEXEDIT to make changes in SS strings corrupted by the "autocalc bug", but it was under Mac OS 9.x.
    Yvan KOENIG (from FRANCE jeudi 2 mars 2006 09:27:56)

  • Want to run export only when the version status is "FINALIZED"

    Hi
    I wanted the DRM users to run certain standard exports only if the version status is "FINALIZED". If it is 'WORKING" or "SUBMITTED", want to prevent the export (with a message that says - cannot run an export with this status) . Is there any way to do this? This is required to implement the process/governance features, so that they do not export the data if it is not final.
    thanks
    -Sushil

    Sushil,
    There is no straightforward way to do this. But I suggest the following solution:
    Create a property to derive a boolean value from the version status and include this value in your export's property query. This will only export values if the version status is set to Finalized.
    To make the user aware that the version status needs to be finalized you may include a header in your export. The header shows the actual version status alongside with a text, that the export will only create result if the status is set to finalized. There is no way to create a validation like message during export.
    Hope this helps.
    Best regards,
    Hauke

  • I am having problems downloading Mozilla Firefox. I select download and wait - then I select run. My computer then says it can't verify the site do I want to run anyway. When I select yes, an error box displays saying that the file is corrupt.

    I have windows 7 on my computer. I am sure it is a setting issue but I do not know how to fix it.

    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See "Disable virus scanning in Firefox preferences - Windows"
    *http://kb.mozillazine.org/Unable_to_save_or_download_files

  • When I try to open some web sites i am blocked by MOZILLA and redirected to a site I did not want and am unable to close or go back without going back to the home page. Help help help

    I have removed the check from the pop up blocked in the MOZILLA options but still get this problem of not being able to open certain sites. The MOZILLA icon appears with the three options available, but before i can click on one I am automatically redirected to a site I did not want, and when I try to go back it will keep coming back to the site MOZILLA put on the computer. I have to close and go back to the home page and start all over again. I have installed a new virus protection system STOPZILLA and could this have any bearing on the problem. After awhile it becomes very frustrating trying to get on line information and being continually redirected. Any ideas?

    There are other things that need attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    *Shockwave Flash 10.0 r32
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • I am running MAC and when I try to open lightroom5, I am getting the following: "This program must be run under Win32" The download link says WIN /MAC. I have no other option.

    What can I do so that I can download this to my MAC?

    Lightroom - all versions
    Windows
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Windows
    Mac
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh

  • InDesign CS5 Not Responding When New Document is Opened

    My InDesign immediately freezes and stops responding after I open a new document and move the cursor. The pinwheel appears and then eventually I have to force quit because it won't come back. I've never produced anything on this version of InDesign before -- I've opened it maybe twice since I installed the master collection last month. I'm using a 2010 macbook pro 15" with plenty of disk space. I uninstalled InDesign and then reinstalled it -- same problem. I removed the preferences and nothing worked. I have a huge project that needs to be done tonight and I am useless without InDesign! Any help would be greatly appreciated.

    This is exactly what is happening to me.
    "What OS are you using? Did this laptop come with Snow Leopard preinstalled, or did you install it yourself? Or are you still running 10.5? People who install 10.6 on top of 10.5 often report strange issues that are hard (or impossible) to track down and fix."
    I'm using Snow Leopard, OS X 10.6.4, which came preinstalled.
    It's a brand new mac so I have enough space and RAM. I already uninstalled the whole suite 3 times and reinstalled it. InDesign still crashes. Then I went a step further and installed my friend's adobe suite with my serial number. The InDesign still crashed. So it must be my computer? I took it to a department tech at my college and he wants to wipe the harddrive clean and see if that helps. But I'm really anxious to do that and want it to be a last resort...

  • Acrobat XI keeps crashing when 2 documents are opened.

    I have installed, deleted and reinstalled Acrobat XI Standard but every time I open 2 PDF Documents, the program stops working and needs too be shut down before I can use it again.... This is very annoying, Please help!!!

    Hi, I'm running Windows 7 Pro 32 Bit. I've just updated Acrobat too 11.0.00 (? not sure if this is the latest version) and now it seems to be working.... I have figured out that another way I can view multiple PDF Documents is to open them with Adobe Reader rather than Acrobat. Thanks. If there are any more issues, I'll be in touch.

  • How to run the Macro in RTF

    Hi Tim,
    Do you know how to run the WORD macro in RTF?
    Suppose I want to run the macro for Section Break, Is there any way we can call it using WORD Macro.
    Any help is appriciated.
    Thanks,
    Ambadas

    Hi Ambadas
    Now, Im not entirely sure what you mena by:
    'Do you know how to run the WORD macro in RTF?'
    Are you looking to run a macro to create a section break for you during the design of the template? - you can do this.
    Or do you want to embed a macro in the RTF output - you can not do this - RTF does not support macros.
    Please explain further.
    Regards, Tim

  • Run a macro on grouped worksheets only

    The Title says it all really:
    I want to run a macro on Grouped worksheets only, not on all worksheets in the workbook (I know how to code for all sheets in a workbook)
    Anyone give me a hand with the code I need to use?
    Many thanks

    Sub Macro1()
    Dim sh As Worksheet
    For Each sh In ActiveWindow.SelectedSheets
    'Use sh as an object in your code
    MsgBox sh.Name
    Next sh
    End Sub

Maybe you are looking for