Results 1 to 3 of 3

Thread: Label layout settings with word automation

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    91

    Label layout settings with word automation

    I am using word automation (WordXp) with my VB6 App.
    I want to change the label settings like width, height, number across, number down, Top margin, Side margin, Vertical en horizontal pitch
    These settings are available in word in window 'Label options', which is a subwindow from window 'Envelopes and Labels'
    Now i want to change these settings programmaticly in vb
    like
    Appword.ActiveDocument.....

    Where can i find this and all settings concerning labels are welcome

    Added info:
    In he meanwhile i allready found several options.
    Now i still need following
    I can get the custom labelnames but not the once in Word itself
    The custom once i get:

    AppWord.mailingLabel.Customlabels(i).Name

    When put in a loop i get all the labelnames and put them in a combobox.
    But Where are the wordlabelnames like AE (2x4) Address.... from the Label options window?
    Last edited by lvermeersch; Apr 6th, 2006 at 09:01 AM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    91

    Re: Label layout settings with word automation

    Still looking for a way in VBA in Word how to get all the label produktnrs
    Ther are listed in window 'Labels and envelopes'. I can only get the 2 custom labels i have made myself but not the once listed in de listbox.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Label layout settings with word automation

    Here is how you can access a labels properties.
    VB Code:
    1. Application.MailingLabel.CustomLabels.Add "TestLabel", False
    2. Application.MailingLabel.CustomLabels.Item("TestLabel").Height = InchesToPoints(1)
    3. Application.MailingLabel.CustomLabels.Item("TestLabel").Width = InchesToPoints(3)
    4. Application.MailingLabel.CustomLabels.Item("TestLabel").SideMargin = InchesToPoints(0.5)
    5. Application.MailingLabel.CustomLabels.Item("TestLabel").TopMargin = InchesToPoints(0.5)
    6. Application.MailingLabel.CustomLabels.Item("TestLabel").PageSize = wdCustomLabelLetter
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width