Propósito

✔ Programação GLOBAL® - Quaisquer soluções e/ou desenvolvimento de aplicações pessoais, ou da empresa, que não constem neste Blog devem ser tratados como consultoria freelance. Queiram contatar-nos: brazilsalesforceeffectiveness@gmail.com | ESTE BLOG NÃO SE RESPONSABILIZA POR QUAISQUER DANOS PROVENIENTES DO USO DOS CÓDIGOS AQUI POSTADOS EM APLICAÇÕES PESSOAIS OU DE TERCEIROS.

.: Vitrine

Carregando artigos...

Views

Mostrando postagens com marcador VBA Word. Mostrar todas as postagens
Mostrando postagens com marcador VBA Word. Mostrar todas as postagens

VBA Word - Captura de tela VBA

VBA Outlook - Exportando Campos para o Excel



Neste exemplo, usaremos captura de tela VBA para copiar a janela ativa para a área de transferência e colá-lo em um documento do Word.

Nós estaremos usando uma API - Application Programming Interface - para capturar a tela que queremos. APIs chamar, ou executar, as funções da janela. 


Para usar a API usaremos hoje, que incluem / declarar que na parte superior do módulo. embora o nosso é declarado como privado, se você quiser acessar uma API de outros módulos que você pode declará-lo com a palavra pública, em vez da palavra privado.

No Word, pressione
ALT + F11 para abrir o editor VBA.


No canto superior esquerdo, clique direito sobre a pasta do módulo no VBA Project Explorer e inserir um novo módulo.


Option Explicit
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Const KEYEVENTF_KEYUP = & H2
Private Const VK_SNAPSHOT = & H2C
Private Const VK_MENU = & H12
Sub ScreenCapture ( )
keybd_event VK_MENU, 0, 0, 0
VK_SNAPSHOT keybd_event, 0, 0, 0
VK_SNAPSHOT keybd_event, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
End Sub
Sub Screen_Capture_VBA ()
Dim Sec3 As Date, PasteYes As Integer
MsgBox "Três segundos após clicar em OK "& _
" a janela ativa será copiado para a área de transferência ".
Sec3 = DateAdd ( "s", 2, Agora)
Until Now> Sec3
DoEvents
laço
ScreenCapture
PasteYes = MsgBox ( "Clique em OK para colar a captura de tela em VBA.", _
VbOKCancel)
Se PasteYes = 1 Then
Selection.Paste
End If
End Sub



Envie seus comentários e sugestões e compartilhe este artigo!

brazilsalesforceeffectiveness@gmail.com

✔ Brazil SFE®✔ Brazil SFE®´s Facebook´s Profile  Google+   Author´s Professional Profile  ✔ Brazil SFE®´s Pinterest       ✔ Brazil SFE®´s Tweets

VBA Word - Formatando o Texto

VBA Word - Formatando o Texto



With Selection.Font
' the Latin text font name and size...   
        .Name = "Verdana"
        .Size = 12
' Bold and Italic are the Font Style...        
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
' The following are the font effects...       
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = True
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = False
        .Subscript = False
' Character spacing...
        .Spacing = -1
        .Scaling = 100
        .Position = -2
        .Kerning = 12
' One of the available Annimation effects.
' Can be one of the following...
' wdAnimationBlinkingBackground
' wdAnimationLasVegasLights
' wdAnimationMarchingBlackAnts
' wdAnimationMarchingRedAnts
' wdAnimationShimmer
' wdAnimationSparkleText
' wdAnimationSparkleText
        .Animation = wdAnimationNone
The font, size, and style of Bidirectional fonts.       
        .SizeBi = 12
        .NameBi = "Tahoma"
        .BoldBi = False
        .ItalicBi = False
    End With



Envie seus comentários
 e sugestões e compartilhe este artigo!

brazilsalesforceeffectiveness@gmail.com

✔ Brazil SFE®✔ Brazil SFE®´s Facebook´s Profile  Google+   Author´s Professional Profile  ✔ Brazil SFE®´s Pinterest       ✔ Brazil SFE®´s Tweets


diHITT - Notícias