CS2 VBA Scripts in CS5

Hi everyone, I am using VBA via MS Excel to import data into InDesign CS2 templates. I am considering upgrading to CS5. Should my VBA scripts work in CS5, or do you suspect there would be a problem?
Thanks everyone,
Mike

Mike,
I split your question off to a new thread. Please don't tag questions onto other threads.
The answer to your question depends on what's in your script, but there's quite a few changes to the object model from CS2 to CS5. You can try putting it into a version folder (i.e. "Version 4.0 Scripts").
Harbs

Similar Messages

  • Upgrade to Vista/Office 2007 blew my CS2 VBA script to heck...

    I am scripting a conversion program in Excel 2007. I cannot get the CreateObject to work. Period. The code worked fine under Office 2003 under XP, but now I get "Type Mismatch" at the
    Set MyInDesign = CreateObject("InDesign.Application.CS2")
    line of code. I have checked the references, and they are on for the InDesign CS2 type library. I have run this as both a standard user and as administrator. No joy.
    I did, however, go into Office 2007 macro settings and change the security settings to enable all macros and trust access to vba project object model. Once I did this, the above line of code generates an "Out of Memory" error.
    Yes, I shouldn't have gambled with changing a Microsoft product, but I figured we would eventually all be using Vista whether we wanted to or not, as Microsoft is dropping support and development of XP soon...
    But regardless, we are dead in the water... any ideas???
    Thanks!!!
    jdb

    Hi,
    Which type of email account are you using? If you are using Exchange or IMAP account, your items are usually delivered to and saved on the mail server. You can also view your items if you configure your email account in another PC.
    If it's only a pst-file in the local disk of your work pc, it's not possible to view the items unless you can go back to your work pc and copy the pst-file to your home pc. I'd like to let you know that a Personal Folders file (.pst) is an Outlook data file
    that stores your messages and other items on your computer. It won't sync to the mail server. See:
    http://office.microsoft.com/en-in/outlook-help/introduction-to-outlook-data-files-pst-and-ost-HA010354876.aspx
    Regards,
    Steve Fan
    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.

  • HELP!! Using a vba script in Outlook to copy attachments to c:\temp folders automatically

    Hi
    I'm brand new to Visual Basic really - you will be able to tell that I am a complete beginner. I wouldn't be posting here but I had tried asking other Forums but have not got any responses.
    This is the problem:- I've found a basic VB script to copy attachments within Outlook 2000 Inbox to the c:temp folder when a new email arrives in. When I debug the script in Outlook > Tools > Macros , it just seems to loop round and round within the
    top function called Application_Startup () and never attempts the objInbox_ItemAdd() function which is the important part. Please can anyone say what is wrong.
    I'm putting all this code within Project1 > Microsoft Outlook Objects > This OutlookSession - I bet I'm putting all this code in the wrong place aren't I? Please help anyone.
    Dim WithEvents objInbox As Outlook.Items
    Private Sub Application_Startup()
    Set objInbox = Session.GetDefaultFolder(olFolderInbox).Items
    End Sub
    Private Sub objInbox_ItemAdd(ByVal Item As Object)
    If Item.Class = olMail Then
    If Item.Attachments.Count > 0 Then
    Dim objAttachments As Outlook.Attachments
    Set objAttachments = Item.Attachments
    For Each objAttach In objAttachments
    ' Does not handle duplicate filename scenarios
    objAttach.SaveAsFile "C:\temp" & objAttach.FileName
    Next
    Set objAttachments = Nothing
    End If
    End If
    End Sub
    Also, I've set the Security to Low within Outlook > Tools> Macros > Security and a bit baffled why this won't run.
    Just for info, I got this VBScript solution from:-
    Outlook Visual Basic for Applications Rules
    Kind Regards
    Matt
    p.s I'm stuck with Outlook 2000 due to a limitation with some Legacy software that my company is still using.

    Thanks jrv.
    At the moment - I don't have the time to learn VBA better along with learning the other things I have an intested in already (e.g. PowerScript) - My customer has an outstanding fault which need fixing urgently. I've spent about 5 hours so fa trying to get
    a VBA script to work withing Outlook but to no avail. I might ask around my company to see if any one else can help or post this on a non-Microsoft forum I think.
    Cheers all the same
    Matt
    So you sold a job to do something you do not knowhow to do.  You are getting paid.  It is your job to learn or to hire someone with the skills you have sold.  We cannot produce custom scripts for an obsolete version of Outlook 2000.. 
    O2000 is almost 15 years old. It is not secure as no security patches have been released for it for almost 10 years.  It is old technology which none of us care to remember unless you want to pay us for the assistance.
    Here is the link to the instructions in th KB that you completely ignored:
    http://support.microsoft.com/kb/235852/EN-US
    It shows you exactly how to do this in Outlook 2000.  You must read all of the instructions carefully.  YOu must try all example code and be sure you understand how it works.  Post all issues with how to use VBA in the Outlook VBA developers
    forum AFTER you have tried that code and have a specific question and not just a requirement for someone to fix this for you.
    The code in the article is explicit to Outlook 2000.  The code you are using is only usable in Outlook 2002 and later.,  You must follow the examples for Outlook 2000 as outlined in your original article.
    If you want to be a technician you need to learn all of these things.  Just knowing how to install a PC is not sufficient if you are going to be a contractor.
    VBA is VBA.  Posting here will not change that.  This is an Admin scarping forum and not an office VBA forum.  VBA is NOT VBScript.  No matter how much it looks like VBScript it is not.
    You cannot just copy VBScript into a VBA module and expect it to work. 
    You have sold the job of a programmer and Outlook developer with no skills in that area.  Is that fair to your customer?
    There are hundreds of skilled developers who have spent good money and time learning to do these things. You cannot just past some things you found on the Internet into a file and ask someone to fix it for you. 
    Start by learning the difference between script and VB.  Next you need to learn what an event is and how it is generated.  The code you posted does nothing in Outlook because it is not Outlook code.
    No.  I am not picking on you.  I am trying to get you to wake up and spend time learning your profession.  It is a lot of fun and actually pretty easy but only if you do your homework.
    ¯\_(ツ)_/¯

  • VBA script for custom Outlook 2010 calendar "first day of week"

    I need Outlook 2010 to use "week starting with the Saturday before Jan 1" as "first week of year" to match our company payroll calendar. (For example, Saturday 12/26/2015-Sunday 1/3/2016 would be "first week of 2016".) Is there
    a way to do this in a VBA script?
    -Thanks, zogg

    Hello zogg,
    The settings are stored in the registry at
    HKCU\Software\Microsoft\Office\15.0\Outlook\Options\Calendar
    where 15.0 stands for Outlook
    2013.
    Make changes in
    the Outlook settings and see which registry values change and in what way depending
    on the settings you change. 
    Also take a look at the How
    can I get the work week and day number in VBA (outlook 2010)? page which states the following:
    WW = Format(Now, "ww") & "." & Weekday(Now, vbMonday)
    The "Format" function returns an expression from a string formatted with the provided "format" argument (ww in
    this case, which returns the week of the year) and the Weekday() function
    returns the numbered day of the week where the first day is a VBDayOfWeek enumeration
    provided as the second argument (vbMonday in
    this case).

  • Import InDesign CS2 Interchange format into CS5

    I have a lot of InDesign CS2 templates and documents. Since it is not possible to open them directly in InDesign CS5, I have used Interchange format from InDesign CS2 and everything worked beautifully.
    But there is a problem. Every text frame from InDesign CS2 Interchange file opened in InDesign CS5, has some info at bottom right corner that consists of a value like 56W (width) and number of characters that are present in the text frame, along with column count (if present) and count of characters that are overflowing.
    Interchange format from CS3 InDesign does not do that. There is no way to create and display those info with text frame created in CS5. If text frame from CS2 Interchange format is converted to picture frame, and back to text frame, that info is also gone.
    I personally find very useful that info displayed at bottom right corner of text frame from CS2 file (except "w" value that does not change even when text frame is resized).
    How can this info be displayed on every text frame created in InDesign CS5 ?

    Indeed files from InDesign CS2 can be opened directly in CS5 ... there is something wrong with files from CS2 ... I suspect on one of installed plug-ins, so lets back to the interesting case of bug "Interchangable CS2 file format in CS5".
    This "problem" can be replicated allways:
    1) Create document in InDesign CS2
    2) create 2 text frames with some text
    3) export document as InDesign CS2 Interchangable format
    4) open that file in InDesign CS5 and you will get bottom corner info from screenshot.
    I would really like to see option to enable this "bug" in CS5 since it makes Info panel redundant in case of text frames.
    I guess that value in front of "W" is some sort of width value ... I calculated and came up with 1W~3.25mm ... W Value is rounded (integer) value so some variations are noticable.
    C stands for nuber of text columns.
    first number in brackets is value of characters in text frame with spaces that is displayed. second is number of characters that are overflowed.
    posted ID_CS2.jpg iz zip file actually. just change extension to zip. there are 2 files. one INDD from CS2 and one INX. just save link as .zip (Save target as).

  • Error in Excel VBA script while using sharepoint web service

    Hi Can you please help me out  in this ?
    nain1987

    Hi Nain,
    According to your description, my understanding is that the error occurred in the Excel VBA scripts which was used to update SharePoint list.
    I recommend to check if the URL of the web service is in the right scope. If the list is in a subsite, the URL should be: http://servername/site/ _vti_bin/Lists.asmx.
    To update SharePoint list using Excel VBA script, you can refer to the link below:
    http://sharepoint.stackexchange.com/questions/34433/update-sharepoint-list-using-excel
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • VBA script for automatically indexing topics

    A big disadvantage with InDesign's indexing system is that you cannot automatically index all occurences of topics currently in the index.
    Instead, you have to find an occurence of each topic in the document itself and go to the Index menus and then click New Page Reference...Add All, for each index topic individually.
    To get around this, I have been trying to produce a VBA script to automatically index all occurrences in a document of the topics currently in the document index.
    I have been using the MS Excel VBA development environment but find the definitions of the object model in the Excel VBA browser rather inadequate and ambiguous .
    Is there a more thorough reference work for these?
    The plan was to start by taking each individual topic in the index which I tried to access with something along the lines of:
    MyDocument.Index.Topic(1)
    This hasn't worked.
    The plan then was to take each index topic and use it to find an occurence in the document of that topic and then use that occurence to invoke the New Page Reference...Add All option to index all occcurences of that selected term, using something like:
    MyDocument.PageReferences.Add
    Again, without success.
    Any guidance or suggestions would be appreciated.

    Dear Peter,
    Many thanks for your posting, that was very helpful.
    This is the state of the script so far (I have added a large number of MsgBox entries - these aren't needed, they are just for debugging purposes during development):
    'VBA script which tries to work through all of the topics in the index and automatically index each occurence of them in the current text frame:
    main
    Function main()
    Set MyInDesign = CreateObject("InDesign.Application.CS4")
    If MyInDesign.Documents.Count > 0 Then
        Set MyDocument = MyInDesign.ActiveDocument
        Set MyPage = MyDocument.Pages.Item(1)
        Set MyTextFrame = MyPage.TextFrames.Item(1)
        Set MyStory = MyTextFrame.ParentStory
        Set MyIndex = MyDocument.Indexes(1)
        Set MyTopics = MyIndex.AllTopics
        MyIndexesCount = MyDocument.Indexes.Count
        MsgBox "Current indexes Count: " & MyIndexesCount
        MyIndexTopicsCount = MyTopics.Count
        MsgBox "Current index topics Count: " & MyIndexTopicsCount
        For i = 1 To MyTopics.Count Step 1 'work through the topics
    MyIndexTerm=MyTopics(i)
    MsgBox "Current indexes Topic: " & MyIndexTerm
    'search for MyIndexTerm :
            'Clear Find preferences:
            MyInDesign.FindTextPreferences = idNothingEnum.idNothing
            'Set up search paramaters:
            If MyIndexTerm <> "" Then
                MyInDesign.FindTextPreferences.FindWhat = MyIndexTerm
                'Set search options:
                MyInDesign.FindChangeTextOptions.CaseSensitive = False
                MyInDesign.FindChangeTextOptions.IncludeFootnotes = False
                MyInDesign.FindChangeTextOptions.IncludeHiddenLayers = False
                MyInDesign.FindChangeTextOptions.IncludeLockedLayersForFind = False
                MyInDesign.FindChangeTextOptions.IncludeLockedStoriesForFind = False
                MyInDesign.FindChangeTextOptions.IncludeMasterPages = False
                MyInDesign.FindChangeTextOptions.WholeWord = False
                'Search for the string:
                Set MyFoundItems = MyDocument.FindText 'this ought to be limited to the Story, not the Document eg MyStory
             MsgBox "Found index terms:" & MyFoundItems.Count
                For j = MyFoundItems.Count To 1 Step -1
                   MyTopics(i).PageReferences.Add MyFoundItems(j)
                Next
               'Clear preference:
                MyInDesign.FindTextPreferences = idNothingEnum.idNothing
                'Having found it, add page reference:
             'MyDocument.PageReferences.Add
            Else
                MsgBox "No search term specified"
            End If
    Response=MsgBox ("Continue?", vbYesNo)
    If Response = vbNo then
      Exit For
    End If
       Next
    'Set up Index options:
    MyIndex.IndexOptions.Title = "Index"
    MyIndex.IndexOptions(1).TitleStyle="Chapter Head"
    MyIndex.IndexOptions(1).ReplaceExistingIndex = True
    'Generate the index:
    MyIndex.Generate
    Else
        MsgBox ("Please open a document, select an object, and try again.")
    End If
    End Function
    There are a couple of problem areas still:
    1. Index terms appear to be added irrespective of whether or not that particular page reference already exists in the index.
    This can result in duplicate page references under each topic - especially if the script is run several times.
    Is there any way of avoiding these duplicate references?
    2. I haven't yet suceeded in getting the script to generate the index - so far I've had to do it manually after the script has run.
    The problem lies somewhere in the code to set up the index options and then generate the index.
    3. It might be useful to be able to limit the indexing to the curent story rather than the whole document - but I haven't yet got it to do that.
    Best wishes.

  • CS2 Standard Upgrade to CS5 Design Premium question

    I've never upgraded from CS2 Standard to CS5 Design Premium because I'd heard that if I do upgrade, I won't be able to open and edit my CS2 docs in CS5. That's a huge problem, because I have years of work docs created in CS2 (in all components: InDesign, Photoshop and Illustrator). Is this a myth and if not, has that "bug" (in my opinion) been straightened out? I don't want to spend the $$ if it's going to cause me a production nightmare. Thanks for any insight!

    You heard wrong. There are no CS5 apps that cannot open files created in earlier versions.
    That said, going the other way will be a problem for some apps such as InDesign.
    You can get the CS2 Design Standard to CS5 Design Premium upgrade at Amazon for $763 with free shipping: http://amzn.to/bVMlqi
    That will save you a few buck over the Adobe list price.
    HTH,
    Bob

  • Macro/VBA script to merge rows with same values in another column

    Hi.
    I'm developing a dance competition application, using Excel 2010, and have so far managed to put judges' marked scores into a worksheet through a userform.
    Now I would like to make the worksheet more presentable as a scoreboard, as you would manually, but via VBA scripts.
    Exhibit Numbers (Column G) are unique identifiers (per competition) for contestants and each contestant is typically judged by three judges.  The scores in three separate categories from one judge would spread in one row so each contestant would have three
    rows.
    I would like to merge rows of columns where the totals from the judges go (Columns P to U) for each contestant.
    I've considered using some kind of loop but I don't have enough experience in vba scripting, it gets overcomplicated. Could someone please help?
    Many thanks.
    Maki Koyama (Canberra, AUS)

    Hi,
    You cannot add a static "Y" inside a when looping over "i". You need to ensure that "Y" changes along with X. Try the modified code below.
    List elements = new ArrayList();
    for (int i=0; i<XXX; i++) {
    IZZZ.IVisibilityElement el = wdContext.createVisibilityElement();
    el.setVisAttr(i); // Change Y to i
    elements.add(el);
    wdContext.nodeVisibility().bind(elements);
    That should give you an idea of what is erroneous in the code.
    Thanks.
    HTH.
    p256960

  • [AS] Versioning to preserve CS3 scripts in CS5

    Hi everyone,
    I've been reading through the thread about what has changed for scripting InDesign CS5. I have been writing scripts for CS3 for about a year and we are upgrading in the new year. I have the demo of CS5 loaded so I can test how the scripts i've written will or won't run.
    Someone indicated in that "what's different" thread that you can "version" the scripts so that they will run in newer versions without having to rewrite the parts of the syntax that have  changed.
    Can someone elaborate on how to do this with AppleScript?
    I put
    tell application "Adobe InDesign CS5"
    set version of script preferences to "5.0"
    at the beginning of the script (and changed all instances of CS3 to CS5 in the script as well) but the script is still not working as with CS3.
    Is there something else I need to do to get CS5 to recognize the syntax of CS3 and understand the commands?
    Thanks

    You will want to set the version back at the end of the script too.
    To deal with the syntax issues, you can wrap the relevant code in:
    using terms from application "Adobe InDesign CS3"
    end using terms from
    You can use the "publish terminology" command to make a dummy dictionary-only version of CS3 so you don't need both versions running; how to do it is documented in the InDesign CS5 Scripting Guide.
    For scripts you run from the Scripts panel, you don't need to make any changes -- just enclose them in a folder called "Version 5.0 Scripts".

  • How to Upgrade cs2 custom plugin on cs5

    Hi all ,
    It'is possible upgrade mac cs2 plugin custom on cs5?
    If yes how?
    Thanks

    Thanks for the answer.
    I have source code and i did it.
    But it'is possilbe upgrade directly plugin from cs2 to cs5 or i have to migrate cs2 to cs3 and cs3 to cs4, and cs4 to cs5?
    Thanks

  • VBA script

    Post Author: sreenivas
    CA Forum: Deployment
    Hi, When I was running the abc Control report I found that itu2019s always picking the reports from one work sheet only itself instead of picking it from the other worksheets as per requirement. While going through some investigation I found that in macro it has been set by default to run one worksheet only. Actually I have Control report in this control report have different different tabs and each tab shows different information. My Question is I need VBA script like i want pick up only particular tab in the Control report. present I am using script Sub main() Application.Interactive = False Application.ExchangeMode = boRepositoryMode Application.ExchangeDomain = "Document" Set bdoc1 = Application.Documents.Open("abc control.rep") Set bdp = bdoc1.DataProviders.Item(2) bdp.Refresh Set mycolumns = bdp.Columns Set myCol = mycolumns.Item("aaa") Set myCol2 = mycolumns.Item("bbb") nmaxline = myCol.Count ReDim lva_report(nmaxline) ReDim lva_report2(nmaxline) For i = 1 To nmaxline Let lva_report(i) = myCol.Item(i) Let lva_report2(i) = myCol2.Item(i) Next bdoc1.Close

    Post Author: pawan
    CA Forum: Deployment
    Hey Srinivas,
    Did you get a solution for your problem, we ended up in an runtime error once it reads Application.ExchangeMode = boRepositoryMode, do you have any thought on this.
    Thanks

  • Programmin​g VBA script for AWR

    Hello everyone, i'd like to make some VBA scripts to run automatically models for AWR.
    CAn anyone tell me how to do this ? or where i can find it ? 
    THank you very much.

    Hello,
        The AWR API is very powerful and can do many things.   It is hard to tell what you are trying to accomplish with this request. Please provide more details.  Additionally, you can find many example scrips here:  https://awrcorp.com/download/faq/english/scripts/s​cripts.aspx
    We also have another page that has resources for scripting here:   https://oldwiki.awrcorp.com/public/scripting/doku.​php
    AWR Support

  • VBA Script Errors on Excel Cell containing a Formula

    I'm writing a VBA script.  When running the script I have a varible being set from a Excel cell containing a formula.  The script errors on this staement.  See below
            Range("O10").Select
            BlockSize = ActiveCell.FormulaR1C1 ' DID Block Size
    Cell O10 contains "=VLOOKUP(A1,SP_DID_Range!A:Q,10,FALSE)"
    The above formula produces the value 20
    What I receive is the formula instead of value the formula produces.
    I am trying retrieve the value and use it in another formula.  So "BlockSize" should equal 20 not "=VLOOKUP(A1,SP_DID_Range!A:Q,10,FALSE)"

    If you want the A1-style formula, use the Formula property.
    If you want the R1C1-style formula, use the FormulaR1C1 property.
    If you want the value, use the Value property:
        BlockSize = Range("O10").Value
    Note that it isn't necessary to select the cell.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • VB Script for CS5

    I am looking for help to update a VB script from InDesign CS2 to InDesign CS5. I have hit a snag with placing a graphic in a named or labeled Frame or box. It has been a few years since I have done much scripting so I am out of the loop of new things.
    If I select the graphic box the script will place the graphic.The line that is commented out.
    But when I try to place it using the label name it fails with error The requested member of the collection does not exist with code 800A7708
    Here is a little of the code where I am having trouble.
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set wshShell = WScript.CreateObject ("WScript.Shell")
    Set myInDesign = CreateObject("InDesign.Application.CS5")
    myInDesign.activate
    set myDocument = myInDesign.Documents(1)
    Set myPage = myDocument.Pages.Item(1)
    ''set MyRectangle = myDocument.Selection.Item(1)
    set MyRectangle = myDocument.Pageitems.item("A1")
    MyRectangle.Place "I:\5_EVOReady\3940249.pdf"
    This code does work properly in Indesign CS2
    Any thoughts or suggestions will be appreciated .

    @rjbull – yes, "something has changed". Since InDesign CS5 you cannot adress the label like that anymore. There is a new property, name, and with item("A1") or itemByName("A1") you'll address the first found pageitem with that particular name in the pageitem collection.
    I'm talking ExtendScript here, not VB Script, but it should be quite the same. Syntax is a bit different, but the basics are the same.
    Unfortunately there is no itemByLabel() method or function. So you have to loop through all the pageitems searching for a pageitem with the label of value "A1".
    See the following posts about that problem and some more issues:
    Harbs
    With CS5, some things have changed
    Oct 3, 2010 1:50 AM
    With CS5, some things have changed
    Uwe

Maybe you are looking for

  • I can't get Google (word & icon) to load in the search bar on my home page. How can I fix this?

    Starting a few weeks ago every time I load my home page in Firefox (v20) the search bar, next to the right side of the address bar, comes up what I call blank. It's just a small blank sheet of paper with the upper corner turned down. What should be i

  • Gantt view - multiple dates in the same row

    Hi, I created gantt view showing employees' vacations. Some of them have their holidays split into several dates (periods). How can I show those multiple dates in the same row in the gantt view? I can only show start date and end date of one vacation

  • Can someone help a non-tech type with connecting AppleTV?

    I want to connect AppleTV3.  My current setup was done 6 yrs ago when I bought TV, Receiver and Speakers.  Sony TV has 3 HDMI inputs, Integra receiver has 2 HDMI inputs.  On receiver HDMI1 is from cable box, HDMI2 is Bluray, HDMI Out goes to TV HDMI1

  • Help!! iPod won't connect or restore!!...

    I have solved many problems over the years with my 160gb iPod Classic but I can't seem to work this one out. My iPod itself is fine.  It works properly, recharges fine, and I use it every day. However recentaly my Ipod Classic won't connect to my PC

  • The disk cannot be partitioned because some files cannot be moved.

    everytime i try to partition my hard drive i get this error message. im not exactly sure if it means to burn it to a disk or back it up on a separate hardrive. any help with this matter would be GREATLY appreciated Back up the disk and use Disk Utili