Nyeste websiteaktivitet

(VBA koder)

Dette er et arbejdesark

Ny Ribbon editor http://www.andypope.info/vba/ribboneditor.htm (undersøg muligehederne for Checkbox)

http://www.excelguru.ca/blog/2006/11/29/modifying-the-ribbon-part-6/

Baggrundsviden til ribbon: http://msdn.microsoft.com/en-us/library/ms406046.aspx

http://www.shaunakelly.com/word/word-development/resources-for-word-vba.html (bla. ny installer)

Undersøg: http://www.mztools.com/v3/download.aspx

 

Editor til ribbon

http://openxmldeveloper.org/archive/2006/05/26/CustomUIeditor.aspx

 

Checkbox http://msdn.microsoft.com/en-us/library/bb410116(v=office.12).aspx

 Læs mere på http://www.rondebruin.nl/ribbon.htm

 


 

Word2007 på Win7
C:\Users\3456\AppData\Roaming\Microsoft\Word\START

Word2010 på Win7 med word2007 installeret tidligere
C:\Users\3456\AppData\Roaming\Microsoft\Word\START


 

 

 <group id="Checkboxtest" label="CheckboxTest">
  <checkBox id="checkbox1"
   enabled="true" getLabel="GetLabel" label="Checkbox1 label"
   keytip="A1" getScreentip="GetScreentip"
   supertip="This is a super tip for the checkBox."
   visible="true" getPressed="GetPressed"
   onAction="OnAction" />
     <checkBox id="checkbox2"
   getLabel="GetLabel" onAction="OnAction" />

 </group>

 

'¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤#############################¤ test
'¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤#############################¤ test
'¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤#############################¤ test

 

'Callback for checkbox1 getLabel
Sub GetLabel(control As IRibbonControl, ByRef returnedVal)
MsgBox "GetLabel"
End Sub

'Callback for checkbox1 getScreentip
Sub GetScreenTip(control As IRibbonControl, ByRef returnedVal)
MsgBox "GetScreenTip"
End Sub

'Callback for checkbox1 getPressed
Sub GetPressed(control As IRibbonControl, ByRef returnedVal)
MsgBox "GetPressed"
End Sub

'Callback for checkbox1 onAction
Sub OnAction(control As IRibbonControl, pressed As Boolean)
MsgBox "OnAction"
End Sub

 

'Public Function GetLabel(ByVal control As IRibbonControl) As String
'    Dim strLabel As String
'    strLabel = ""
'    Select Case control.ID
'        Case "checkbox1": strLabel = "Insert text."
'        Case "checkbox2": strLabel = "Insert more text."
'    End Select
'        MsgBox strLabel
'End Function
'Public Function GetScreenTip(ByVal control As IRibbonControl) As String
''    Return "Inserts text into the active worksheet."
'End Function'

'Public pressedState As Boolean
'pressedState = False
'
'Public Function GetPressed(ByVal control As IRibbonControl) As Boolean
'    MsgBox pressedState
'End Function
'Public Sub OnAction(ByVal control As IRibbonControl, ByVal pressed As Boolean)
'    If pressed Then
'       MsgBox " applicationObject.Range(A1).Value valgt textbox"
'    Else
'        MsgBox "applicationObject.Range(A1).Value = You cleared the check box."
'    End If
'    pressedState = pressed  'bør være true?
'End Sub

 

 

 

 

Teknisk artikel om Word http://support.microsoft.com/kb/921541

 

 

Sub MarkerIFarver()
'Fremhæver sætninger med spørgsmålstegn med blå og fed.
'http://www.vbaexpress.com/forum/archive/index.php/t-23254.html
Dim r As Range
Set r = ActiveDocument.Range
With r.Find
    Do While .Execute(Findtext:="?", Forward:=True) = True
    With r
        .Expand Unit:=wdSentence
        .Font.Bold = True
        .Font.Color = wdColorBlue
        .Collapse Direction:=wdCollapseEnd
    End With
    Loop
End With
End Sub

 

 


Ribbon http://msdn.microsoft.com/en-us/library/dd756403.aspx

http://www.rondebruin.nl/galleries.htm

XML oversigt http://msdn.microsoft.com/en-us/library/aa722523(v=office.12).aspx


http://benread.net/tools/Macros-Word-Annotation.htm

Range.MoveUntil Method

Moves the specified range until one of the specified characters is found in the document.

Syntax

expression.MoveUntil(Cset, Count)

expression   Required. A variable that represents a Range object.

Parameters

Name Required/Optional Data Type Description
Cset Required Variant One or more characters. If any character in Cset is found before the Count value expires, the specified range is positioned as an insertion point immediately before that character. This argument is case sensitive.
Count Optional Variant The maximum number of characters by which the specified range is to be moved. Can be a number or either the wdForward or wdBackward constant. If Count is a positive number, the range is moved forward in the document, beginning at the end position. If it is a negative number, the range is moved backward, beginning at the start position. The default value is wdForward.

Remarks

This method returns the number of characters by which the specified range was moved, as a Long value. If Count is greater than 0 (zero), this method returns the number of characters moved plus one. If Count is less than 0 (zero), this method returns the number of characters moved minus one. If no Cset characters are found, the range isn't not changed and the method returns 0 (zero).

Example

This example moves myRange forward through the next 100 characters in the document until the character "t" is found.

Visual Basic for Applications
Set myRange = ActiveDocument.Words(1)
myRange.MoveUntil Cset:="t", Count:=100





Range.Text Property
Returns or sets the text in the specified range or selection. Read/write String. Read/write String.

Syntax

expression.Text

expression   A variable that represents a Range object.

Remarks

The Text property returns the plain, unformatted text of the range. When you set this property, the existing text in the range is replaced.

Example

This example replaces the first word in the active document with "Dear."

Visual Basic for Applications
Set myRange = ActiveDocument.Words(1)
myRange.Text = "Dear "



http://peltiertech.com/Excel/XL_PPT.html



http://msdn.microsoft.com/en-us/library/bb221280.aspx
Sub Macro()
Selection.HomeKey Unit:=wdStory
Selection.MoveRight Unit:=wdWord, Count:=2, Extend:=wdExtend
Selection.Font.Bold = wdToggle
End Sub

The following example accomplishes the same task without selecting the text or using the Selection object.

Sub WorkingWithRanges()
ActiveDocument.Range(Start:=0, _
End:=ActiveDocument.Words(2).End).Bold = True
End Sub
 
 
Dictus XP rens tekst kode
 
'RensTekstDictusXP
Sub RensTekstDictusXP()
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .text = " ,"
        .Replacement.text = ","
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .text = " ."
        .Replacement.text = "."
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.WholeStory
    Selection.Range.Case = wdTitleSentence
    'Selection.HomeKey Unit:=wdStory
    Selection.EndKey Unit:=wdStory
End Sub