Why wont this Macro work with my custom watermarks, but finds the built-in building blocks from office 2010?

Option Explicit
Sub BatchProcess()
Dim strFileName As String
Dim strPath As String
Dim oDoc As Document
Dim oLog As Document
Dim oRng As Range
Dim oHeader As HeaderFooter
Dim oSection As Section
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
    .Title = "Select folder and click OK"
    .AllowMultiSelect = False
    .InitialView = msoFileDialogViewList
    If .Show <> -1 Then
        MsgBox "Cancelled By User", , _
               "List Folder Contents"
        Exit Sub
    End If
    strPath = fDialog.SelectedItems.Item(1)
    If Right(strPath, 1) <> "\" _
       Then strPath = strPath + "\"
End With
If Documents.Count > 0 Then
    Documents.Close savechanges:=wdPromptToSaveChanges
End If
Set oLog = Documents.Add
If Left(strPath, 1) = Chr(34) Then
    strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFileName = Dir$(strPath & "*.doc?")
While Len(strFileName) <> 0
    WordBasic.DisableAutoMacros 1
    Set oDoc = Documents.Open(strPath & strFileName)
    'Do what you want with oDoc here
    For Each oSection In oDoc.Sections
        For Each oHeader In oSection.Headers
            If oHeader.Exists Then
                Set oRng = oHeader.Range
                oRng.Collapse wdCollapseStart
                InsertMyBuildingBlock "ASAP 1", oRng
            End If
        Next oHeader
    Next oSection
    'record the name of the document processed
    oLog.Range.InsertAfter oDoc.FullName & vbCr
    oDoc.Close savechanges:=wdSaveChanges
    WordBasic.DisableAutoMacros 0
    strFileName = Dir$()
Wend
End Sub
Function InsertMyBuildingBlock(BuildingBlockName As String, HeaderRange As Range)
Dim oTemplate As Template
Dim oAddin As AddIn
Dim bFound As Boolean
Dim i As Long
bFound = False
Templates.LoadBuildingBlocks
For Each oTemplate In Templates
    If InStr(1, oTemplate.Name, "Building Blocks") > 0 Then Exit For
Next
For i = 1 To Templates(oTemplate.FullName).BuildingBlockEntries.Count
    If Templates(oTemplate.FullName).BuildingBlockEntries(i).Name = BuildingBlockName Then
        Templates(oTemplate.FullName).BuildingBlockEntries(BuildingBlockName).Insert _
                Where:=HeaderRange, RichText:=True
        'set the found flag to true
        bFound = True
        'Clean up and stop looking
        Set oTemplate = Nothing
        Exit Function
    End If
Next i
If bFound = False Then        'so tell the user.
    MsgBox "Entry not found", vbInformation, "Building Block " _
                                             & Chr(145) & BuildingBlockName & Chr(146)
End If
End Function
This works, using the ASAP 1 watermark that is in bold. ASAP 1 is a built-in building block, if i just rename this to ASAP, but save it in the same place with buildingblocks.dotx it wont work. What do i need to do to be able to use this with my custom building
blocks?

Hi,
This is the forum to discuss questions and feedback for Microsoft Excel, this issue is related to Office DEV, please post the question to the MSDN forum for Excel
http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&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
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.

Similar Messages

  • Why wont google toolbar work with fire fox 5????? also how can i get firefox 4 back so i can use the toolbar???

    Hello,my question is why wont google toolbar work with firefox 5?????
    Also how can i get firefox 4 back so i can use the toolbar???

    This page is an easier way to download Firefox 4.0: http://www.mozilla.com/en-US/products/download.html?product=firefox-4.0&os=win&lang=en-US , as this links starts the download process asap.
    I needed to upgrade to Firefox 4.0+ for an add-on that I really needed. However, I can't use Firefox 5.0, as I randomly checked 3 add-on's I had: "Firefox PDF", "Delicious Bookmarks" and "After the Deadline", and none of them worked with Firefox 5.0. In fact, I will have to download alpha versions, etc., to get these add-ons to work with Firefox 4.0.

  • Why wont this script work???

    Hi,
    I have previously used this script to make a portrait scroll bar which works perfectly, however i have altered the script to work in a landscape scroll bar by altering the x and y axis and switching out the height for width. However a part of it wont work...The left and right arrows work correctly however the scroll bar does not move and I can not for the life of me figure out why.
    Does anyone have any ideas as to what ive missed or done wrong?
    Thanks in advance
    scrolling = function () {
    var scrollWidth:Number = scrollTrack._width;
    var contentWidth:Number = contentMain._width;
    var scrollFaceWidth:Number = scrollFace._width;
    var maskWidth:Number = maskedView._width;
    var initPosition:Number = scrollFace._x=scrollTrack._x;
    var initContentPos:Number = contentMain._x;
    var finalContentPos:Number = maskWidth-contentWidth+initContentPos;
    var left:Number = scrollTrack._y;
    var top:Number = scrollTrack._x;
    var right:Number = scrollTrack._y;
    var bottom:Number = scrollTrack._width-scrollFaceWidth+scrollTrack._x;
    var dy:Number = 0;
    var speed:Number = 10;
    var moveVal:Number = (contentWidth-maskWidth)/(scrollWidth-scrollFaceWidth);
    scrollFace.onPress = function() {
      var currPos:Number = this._x;
      startDrag(this, false, left, top, right, bottom);
      this.onMouseMove = function() {
       dy = Math.abs(initPosition-this._x);
       contentMain._x = Math.round(dy*-1*moveVal+initContentPos);
    scrollFace.onMouseUp = function() {
      stopDrag();
      delete this.onMouseMove;
    btnUp.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x+speed<maskedView._x) {
        if (scrollFace._x<=top) {
         scrollFace._x = top;
        } else {
         scrollFace._x -= speed/moveVal;
        contentMain._x += speed;
       } else {
        scrollFace._x = top;
        contentMain._x = maskedView._x;
        delete this.onEnterFrame;
    btnUp.onDragOut = function() {
      delete this.onEnterFrame;
    btnUp.onRelease = function() {
      delete this.onEnterFrame;
    btnDown.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x-speed>finalContentPos) {
        if (scrollFace._x>=bottom) {
         scrollFace._x = bottom;
        } else {
         scrollFace._x += speed/moveVal;
        contentMain._x -= speed;
       } else {
        scrollFace._x = bottom;
        contentMain._x = finalContentPos;
        delete this.onEnterFrame;
    btnDown.onRelease = function() {
      delete this.onEnterFrame;
    btnDown.onDragOut = function() {
      delete this.onEnterFrame;
    if (contentWidth<maskWidth) {
      scrollFace._visible = false;
      btnUp.enabled = false;
      btnDown.enabled = false;
    } else {
      scrollFace._visible = true;
      btnUp.enabled = true;
      btnDown.enabled = true;
    scrolling();

    sorry should have said...its the aspect relating to "scrollFace" which is mentioned throughout..ive marked it out in bold and taken out anything unrelivant.
    Thanks
    So its:
    scrolling = function () {
    var scrollFaceWidth:Number = scrollFace._width;
    var initPosition:Number = scrollFace._x=scrollTrack._x;
    var bottom:Number = scrollTrack._width-scrollFaceWidth+scrollTrack._x;
    var moveVal:Number = (contentWidth-maskWidth)/(scrollWidth-scrollFaceWidth);
    scrollFace.onPress = function() {
      var currPos:Number = this._x;
      startDrag(this, false, left, top, right, bottom);
      this.onMouseMove = function() {
       dy = Math.abs(initPosition-this._x);
       contentMain._x = Math.round(dy*-1*moveVal+initContentPos);
    scrollFace.onMouseUp = function() {
      stopDrag();
      delete this.onMouseMove;
    btnUp.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x+speed<maskedView._x) {
       if (scrollFace._x<=top) {
         scrollFace._x = top;
        } else {
         scrollFace._x -= speed/moveVal;
        contentMain._x += speed;
       } else {
        scrollFace._x = top;
        contentMain._x = maskedView._x;
        delete this.onEnterFrame;
    btnDown.onPress = function() {
      this.onEnterFrame = function() {
       if (contentMain._x-speed>finalContentPos) {
       if (scrollFace._x>=bottom) {
         scrollFace._x = bottom;
        } else {
         scrollFace._x += speed/moveVal;
        contentMain._x -= speed;
       } else {
       scrollFace._x = bottom;
        contentMain._x = finalContentPos;
        delete this.onEnterFrame;
    if (contentWidth<maskWidth) {
      scrollFace._visible = false;
      btnUp.enabled = false;
      btnDown.enabled = false;
    } else {
      scrollFace._visible = true;
      btnUp.enabled = true;
      btnDown.enabled = true;

  • Why wont my netflix work with silverlight

    Whenever I try to play Netflix it says there is a SIlverlight Installation problem, I uninstall and it then reinstall and goes staight back to the same problem. How do I fix this?

    I have this same issue. I have uninstalled and installed silverlight multple times and it still will not play. wondering if there is anything else you can do?

  • Panasonic TV. Apple TV works with one HDMI input but not the other.

    I have the latest version of Apple Tv and an older Panasonic TX32LXD60 Tv. The TV has two HDMI inputs. Apple TV works perfectly on HDMI1, but shows nothing on HDMI2. I am using exactly the same cable. HDMI2 works fine with my DVD player. Can anyone explain how I can get HDMI2 to accept Apple TV?

    Update - Panasonic support wrote the following:
    "Thank you for your e-mail enquiry regarding your Panasonic product.
    I have discussed your issue with our head office AV technica ldept & they have confirmed that as the DVD player works on the HDMI input there is nothig wrong with the TV. It may be there is an incompatability with the apple TV interface & the TV. Nothing can be done to solve this as there would be not adjustments you could make to the HDMI inputs on the TV."
    so according to them its not their product!
    I have solved my problem by getting a Samsung TV - brilliant picture and no technical problems (so far!!)

  • Why isnt my ringtone working with facetime?

    why isnt my ringtone working with facttime?

    If you confirmed the headphones are not the problem.
    - Try cleaning out/blowing out the headphone jack. Try inserting/removing the plug a dozen times or so.
    Try the following to rule out a software problem
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iPod.
    - Make an appointment at the Genius Bar of an Apple store. Seems you have a bad headphone jack.
    Apple Retail Store - Genius Bar
    If not under warranty Apple will exchange your iPod for a refurbished one for this price. They do not fix yours.
    Apple - iPod Repair price                  
    A third-party place like the following will replace the jack for less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    Replace the jack yourself
    iPod Touch Repair – iFixit

  • I have an ipod touch and now it doesnt sync properly. It gets to stage 1 of 3 of syncing( Which is 'backing up') Then it stops and itunes closes. Why wont this sync and what can I do about it?

    I have an ipod touch and now it doesnt sync properly. It gets to stage 1 of 3 of syncing( Which is 'backing up') Then it stops and itunes closes. Why wont this sync and what can I do about it?

    Hello,
    I am currently an owner of an Ipod Touch 4th generation. I see you are having problems with your Ipod Touch, so I will try to find a solution to your problem.
    Restart the Computer. This sometimes happens to me when I keep my Windows 7 on Sleep, and I try to sync my Ipod
    Make sure you have the latest version of Itunes
    Hope that helps!
    If none of the above solutions work, can you please respond back ASAP as I will try to find another solution to your problem (This might even help others with the same problem!)
    Cheers!
    Pizza98704

  • I upgraded for Firefox 4 and now my simplePass identity protection (biometric scanner) on my laptop will not work. WHY? It still works with IE but I don't use IE.

    I upgraded for Firefox 4 and now my HP SimplePass Identity Protection (biometric scanner) on my laptop will not work. WHY? It still works with IE but I don't use IE. It worked with the previous Firefox version but now when I use the internet, it doesn't even acknowledge I have the scanner. When I run my finger over it, it opens the settings panel but does not allow use of the already saved information or allow new information to be entered. I need this corrected. Any suggestions?

    I asked this same question, and just received a response:
    "Thank you for contacting DigitalPersona. There will be no update releases
    for DigitalPersona Personal in the future. There will be no updates for
    Firefox 4 nor Internet Explorer 9. IF they work they work, if they do
    not work with DPPersonal, then you will have to decide to either keep
    DPPersonal and forgo Firefox 4 or IE 9, or vice versa. DigitalPersona
    is leaving the consumer market and is focusing on business applications.
    In fact, DigitalPersona Personal will not longer be supported after
    Mid-April of this year.
    We apologize for any inconvenience this might cause. Sincerely, Tech Team "
    In other words, there will be NO update.

  • Why won't icloud work with windows vista anymore?

    why won't icloud work with windows vista anymore?

    I had to re-install after the newly released iTunes - for Vista it does work with iClud 2 - not 3. You can download from this site.

  • Hypertext links are not always preserved from Word to PDF, using Aperçu or Adobe, depending on OS 10 or Lion. Why? This generally works perfectly in Windows. Why are Apple and Adobe unable to correctly handle links when converting from Word to PDF?

    Hypertext links are not always preserved from Word to PDF, using Aperçu or Adobe, depending on OS 10 or Lion. Why? This generally works perfectly in Windows. Why are Apple and Adobe unable to correctly handle links when converting from Word to PDF?
    Depending on the system version, and Office Word version:
    - a pure URL link starting with http or even www sometimes works in PDF, either produced by Aperçu or Adobe, sometimes does not work;
    - other kind of links where the text under display is not a URL, never work!
    I like everything with Apple computers and software, except PDF generation. Output files are usually bigger in size, and no better quality, than under Windows. Furthermore, it is weird that something as common as hyperlinks does not work correctly!
    I related this question with Mac OS X Snow Leopard, but the problem is still there with Mac OS Lion.
    This problem seems to have been around for years, without any proper solution from Apple and/or Adobe! To me, this is very embarrassing!

    Greetings NoNameGiven,
    If I understand the problem correctly (I’m not sure I do) you would prefer ‘iii’ to be read as “eye eye eye” rather than “three”? The alt text property is the only way that I know of to make this happen. Hope this helps.
    a ‘C’ student

  • Why is scrolling not working with multiple youtube embeds layed out vertically in a stack on one page?

    Why is scrolling not working with multiple youtube embeds layed out in a stack on one page?

    Hi ,  
      This is a sort of performance issue , because your program takes more than the max time set for the program to execute in foreground.
    There are many stuff in program which will hamper your performance.
    I will list down a few
    1. SELECT *
    FROM konp
    INTO CORRESPONDING FIELDS OF TABLE konp_itab
    FOR ALL ENTRIES IN a363_itab
    WHERE knumh EQ a363_itab-knumh
    in this statement you are using for all entries a363_itab , but before this statement you are not checking if the table has any entry or not , please do remember that for all entries has this characterstic , that if you internal table does not contain any record , then all the records are selected from the database table. So in this case if you table a363_itab is empty , so what you want is no data must be seelcted from table konp , but what will happen is all the records in KONP will be seelcted.
    2. While retreiving data you are using seelct * even though you do not require all the fields , an example is
    <b>SELECT *
    FROM mkpf
    INTO CORRESPONDING FIELDS OF TABLE mkpf_itab
    FOR ALL ENTRIES IN mseg_itab
    WHERE mblnr EQ mseg_itab-mblnr.</b>
    in this your internal table contains only 2 fields
    <b>mblnr LIKE mkpf-mblnr, "Number of Material Document
    bldat LIKE mkpf-bldat, "Document Date in Document</b> , but to get these 2 fields you are selecting all the fields of the table.
    3. In select you are using into corresponding fields of table , it is not a good practice., so please avoidd it.
    Please understand that you must try to reduce the access to your database tables and try to keep it minimal , because this same thing may happen becasue data in DEV is very less compared to the volume of data in production , so a program working in DEV will take much more time in PRD if not written properly and may result in timeouts , as in your case.
    Please try to make chanegs to the prorgam and see if it works.
    In case you have more queries , please do revert back.
    Regards
    Arun
    *Reward points if replay is helpful

  • Ill.CS3 - Why can I only work with one sheet on the desktop? I want to design a multi page document...

    ill.CS3 - Why can I only work with one sheet on the desktop? I want to design a multi page document...

    Use this ancient work-around:
    Create mutli-page PDF | Illustrator

  • Will default macros work  with Time series keyfigures???

    Hi,
    I wanted to update time series keyfigures using Default macros. For example, i wanted to populate safety stock in a time series keyfigure while i'm running the heuristics in background.
    Whole idea of doing it is to do reporting i.e. we couldnot extract safety stock because its an auxialiary key figure.
    If someone has done this on a better way, can you please share with me?
    And also i wanted to know whether default macros work with time series key figures.
    Any help is rewarded with pionts.
    Thanks & Regards,
    Jagadeesh.

    Hi,
    I think i'm not clear on what i have posted so let make it very clear abt my scenario.
    We wanted to do reporting on SNP planning area, where we take report on
    Safety stock, Stock on hand which are auxialiry key figures currently.
    As we cannot extract data on auxialiry key figures, we wanted to track
    those information on Time series key figures.For that, we have modified
    the macros and copied the auxialiry key figures into time series key
    figures. All the macros are Default macros, all the prerquisites are been set and all other macros which are supposed to run before this macro, also been set.
    We are not running the bcakground jobs for this macros ( exclusively), instead we are running the heuristics in background and we assume that all the default macros will get executed once the heuristics is done i.e values in auxialiry key figures are been copied to time series key figures.
    Now we found out that Times series key figures are not getting updated
    using Default macros.
    Nowi think i make you all clear. Somehow my questions are still not answered.
    1. Without running background jobs seperately for macros, will time series key figures get updated?
    Thanks & Regards,
    Jagadeesh.

  • Why wont my volume work on my iPhone 4s?

    why wont my volume work on my iPhone 4s?

    Hey Chelsreb,
    Thanks for the question. I understand you are experiencing issues with your iPhone 4s. The following resource may provide a solution:
    iPhone: No sound or distorted sound from speaker
    http://support.apple.com/kb/ts5180
    1. Verify that the volume is set to a level you would normally be able to hear.
    2. Ensure that there is nothing plugged in to the headset jack or the dock connector.
    3. If the iPhone is in a protective case, make sure that the speaker port isn't blocked by the case.
    4. Make sure that the speaker and dock port aren't clogged with debris. If necessary, clean it with a clean, small, dry, soft-bristled brush. Carefully and gently brush away any debris.
    5. If an audio issue occurs when using a specific application, try testing other applications to see if the issue persists.
    6. If the iPhone is paired with a Bluetooth headset or car kit:
              - Try turning off Bluetooth.
              - If you experience difficulties with the Bluetooth feature, follow these troubleshooting steps.
    7. Restart the iPhone.
    8. If restarting doesn't fix the issue, ensure that your iPhone is updated to the latest version of iOS.
    9. If the issue is not resolved after restoring the iPhone software, please contact Apple Support.
    If the issue persists, please follow the last step by contacting Apple Support for support and service options.
    Thanks,
    Matt M.

  • Cannot sync my outlook calendar with my iPhone 6 plus.  When I added my email for verizon Calendar was not an option.  This was working with my 4S iPhone.

    Cannot sync my outlook calendar with my iPhone 6 plus.  When I add my email for Verizon, calendar was not an option.  This was working with my 4S iPhone.  Also around the time I switched for iPhone 4 to 6 the operating system was updated to 8.

    carol frommanassas wrote:
    Cannot sync my outlook calendar with my iPhone 6 plus.  When I add my email for Verizon, calendar was not an option.  This was working with my 4S iPhone.  Also around the time I switched for iPhone 4 to 6 the operating system was updated to 8.
    Then ask Verizon what the issue is and why there is no option for calendar.

Maybe you are looking for

  • Can't open iphoto library from external hard drive

    I'm backing up my enormous iPhoto library to two external hard drives in order to free up space on my computer. Before deleting the photos permanently from the laptop, I wanted to double-check that the copies of the library I made on the two external

  • Cs3 indesign export to pdf slow

    When I export to pdf with a new file name the process is very quick, if I export the same document for a second time using the same pdf file name (overwrite exsisting file) it goes very slow and I get the "not responding message" if I wait long enoug

  • Premiere CS4 Audio Effects Only Work On Latter Half Of Each Audio Clip

    I'm currently working with Premiere CS4 on a Windows 7 PC and running into some audio issues when exporting the video. In the timeline when I playback the preview the audio sounds fine but when I export it the audio effects I applied in Premiere only

  • Notifications failed to send mail for journal approval with attachments

    Issue : Notifications failed to send mail for journals sent for approvals with attachments. Error : [WF_ERROR] ERROR_MESSAGE=3835: Error '-6502 - ORA-06502: PL/SQL: numeric or value error: character string buffer too small' encountered during executi

  • Can't activate my iPhone 6.1.3

    After update I was getting manny issues like 1611 error, restored to factory settings, now I am not able to bypass activation screen. Phone is locked to ATT,never been unlocked, I cant find my ATT card, is there any way to activate it without using A